I am trying to deploy an AzureFunctions in NodeJs but it doesn't work on Azure. My apllication is a v3 functions running on Linux.
When the deploy is completed, i get this 500 error:
Error: /home/site/wwwroot/node_modules/canvas/build/Release/canvas.node: invalid ELF header
Its happen only when I do this imports:
import ChartDataLabels from 'chartjs-plugin-datalabels';
const canvasRenderService = new CanvasRenderService(width, height, chartCallback);
const chartCallback = (ChartJS) => {
ChartJS.register(require('chartjs-plugin-datalabels'))
};
const jsdom = require("jsdom");
const { JSDOM } = jsdom;
const { document } = (new JSDOM(`...`)).window;
Would someone help me please?
It works (only) on my machine :(
Edit: It works when I make the deploy by Linux Subsystem. I hope this will help somebody.