Closed clarson1229 closed 2 years ago
I happen to have the same issue, and it seems to be related to Webpack.
check the npm list
first.
if you get error message npm ERR! peer dep missing: chart.js@^2.x.x
or Error: Cannot find module 'chart.js'
you need download chart.js to complited chartjs-node-canvas
module
by run npm i chart.js
check the npm list
again after that
Yes, chart.js is a peer dependency so you need to install it yourself
Hello, Context: I am trying to Create an auto email service that runs on a timer and sends emails out on a scheduled basis. I use Cronjobs.org which hits my Lambda function hosted on netlify. This function creates the email template and then sends the email using SendGrid. This all works fine and dandy Until I try to put a chart into this template.
The issue is I cannot get chartjs to create the said chart.
Because I am using a lambda function to create this email template no canvas object is available. This is where I stumbled upon this library as it looks like it can do exactly what I want.
Problem: Using the default chart from the documentation to test things. I want to be able to create the graph that then renders it to a URL that can be sent to an image tag. However, whenever the lambda function is called from netlify it returns the error :
{"errorType":"Runtime.ImportModuleError","errorMessage":"Error: Cannot find module 'chart.js'"
Chart.js is installed and I have tried numerous variations of require statements that still are not working.Any help would be appreciated.