Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visual Artifact/Glitch in Chart rendered on Node server #125

Open
chxpel opened this issue Dec 19, 2022 · 0 comments
Open

Visual Artifact/Glitch in Chart rendered on Node server #125

chxpel opened this issue Dec 19, 2022 · 0 comments

Comments

@chxpel
Copy link

chxpel commented Dec 19, 2022

I spent 5 hours yesterday debugging the "canvas.node is not a valid win 32 application" bug.
This was occurring because I was deploying to a Windows server, but using a pipeline running on Ubuntu.

Then, I had to deal with "Error: The module ...canvas.node'was compiled against a different Node.js version usingNODE_MODULE_VERSION 93. This version of Node.js requiresNODE_MODULE_VERSION 83. Please try re-compiling..."

I managed to fix this by forcing my pipeline to run Node 14 instead of 16.

I've got an Azure DevOps pipeline that deploys a NestJS (Node) app to a Windows server.
Part of this app is an API which has an endpoint that renders a chart into a PDF.
This works fine locally.

Once I finished fixing this bug and getting my app to deploy, this is what the PDF looks like:

image

This is what the exact same code looks like running locally:
image

On my machine, I run Node 12.22.1
For the pipeline, I am using Node 12.22.1
My package.json has chart.js version 3.9.1 and chartjs-node-canvas version 4.1.6

My actual server is running Node 12.21.0

I've tried messing around with versions of node, chartjs, and chartjs-node-canvas, but it is very, very easy to trigger the error "The module was compiled against a different node version...". My best idea so far was to make sure my local machine, pipeline, and deployment server were all running Node 12. I then downgraded both dependencies, but continued receiving the different node version error mentioned above.

Does anyone familiar with this package have any idea why this is happening? It's so weird. This is delaying a very important release.

Also can I post this anywhere else? Not sure if the other canvas related communities can help. I truly am desperate here.

@chxpel chxpel changed the title Visual Artifact/Glitch in Chart Visual Artifact/Glitch in Chart rendered on Node server Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant