You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a node JS application deployed on Azure functions using Azure dev-ops pipeline. Dev-ops pipeline uses ubuntu-latest vmImage. After the deployment when I run my function I get the following error.
Error: \?\C:\home\site\wwwroot\node_modules\canvas\build\Release\canvas.node is not a valid Win32 application. \?\C:\home\site\wwwroot\node_modules\canvas\build\Release\canvas.node at Module._extensions..node (node:internal/modules/cjs/loader:1452:18) at Module.load (node:internal/modules/cjs/loader:1197:32) at Module._load (node:internal/modules/cjs/loader:1013:12) at Module.require (node:internal/modules/cjs/loader:1225:19) at Object.apply (C:\Program Files (x86)\SiteExtensions\Functions\4.34.2\workers\node\dist\src\worker-bundle.js:2:51713) at require (node:internal/modules/helpers:177:18) at Object. (C:\home\site\wwwroot\node_modules\canvas\lib\bindings.js:3:18) at Module._compile (node:internal/modules/cjs/loader:1356:14) at Module._extensions..js (node:internal/modules/cjs/loader:1414:10) at Module.load (node:internal/modules/cjs/loader:1197:32)
Environment
===================================================================
Azure Function Configuration:
Issue
I have a node JS application deployed on Azure functions using Azure dev-ops pipeline. Dev-ops pipeline uses ubuntu-latest vmImage. After the deployment when I run my function I get the following error.
Error: \?\C:\home\site\wwwroot\node_modules\canvas\build\Release\canvas.node is not a valid Win32 application. \?\C:\home\site\wwwroot\node_modules\canvas\build\Release\canvas.node at Module._extensions..node (node:internal/modules/cjs/loader:1452:18) at Module.load (node:internal/modules/cjs/loader:1197:32) at Module._load (node:internal/modules/cjs/loader:1013:12) at Module.require (node:internal/modules/cjs/loader:1225:19) at Object.apply (C:\Program Files (x86)\SiteExtensions\Functions\4.34.2\workers\node\dist\src\worker-bundle.js:2:51713) at require (node:internal/modules/helpers:177:18) at Object. (C:\home\site\wwwroot\node_modules\canvas\lib\bindings.js:3:18) at Module._compile (node:internal/modules/cjs/loader:1356:14) at Module._extensions..js (node:internal/modules/cjs/loader:1414:10) at Module.load (node:internal/modules/cjs/loader:1197:32)
Environment
===================================================================
Azure Function Configuration:
===================================================================
npm list canvas
:+-- canvas@2.11.2
-- pdf-to-img@4.1.0 +-- canvas@2.11.2 deduped
-- pdfjs-dist@4.2.67`-- canvas@2.11.2 deduped
===================================================================
node version: node -v
v18.19.1
===================================================================
node -p "process.arch"
Output: x64
===================================================================
// saved in a file and then run with node
const fs = require("fs");
const path = require("path");
const cnode = path.join(require.resolve("canvas"), "../build/Release/canvas.node");
const fd = fs.openSync(cnode);
const b = Buffer.alloc(4);
fs.readSync(fd, b, 0, 4, 60);
const pe_addr = b.readUInt32LE(0);
fs.readSync(fd, b, 0, 2, pe_addr + 4);
const type = b.readUInt16LE(0);
console.log(type.toString(16));
Output: 1e
===================================================================
System Info:
OS version: Microsoft Windows NT 10.0.20348.0
64 bit system: True
64 bit process: True
Processor count: 1
===================================================================
Let me know if you need any other information.
The text was updated successfully, but these errors were encountered: