-
Notifications
You must be signed in to change notification settings - Fork 447
netlify dev reload causes error: "Module did not self-register" with node-canvas #2641
Copy link
Copy link
Closed
Labels
area: command: devarea: redirectstype: bugcode to address defects in shipped codecode to address defects in shipped code
Description
Describe the bug
Any time I change any file inside my netlify/functions/ folder, the node-canvas module fails to load on the next request. I have to stop netlify dev and rerun it.
To Reproduce
Simple code to reproduce uploaded here:
https://github.com/amerkay/netlify-cli-dev-bug
Steps to reproduce the behavior:
- Run locally using
netlify dev.
Then check the output at http://localhost:8888/.netlify/functions/test-canvas - Change anything in the function's file
test-canvas.js, like changing the text string. This triggers a function reload.
"◈ .../netlify/functions/test-canvas.js modified, successfully reloaded!" - Refresh the /test-canvas function in the browser, now you get the error:
"Error: Module did not self-register"
Configuration
Happens without any toml config.
npx envinfo --system --binaries --npmPackages netlify-cli --npmGlobalPackages netlify-cli
System:
OS: Linux 5.12 Manjaro Linux
CPU: (8) x64 Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
Memory: 3.95 GB / 15.56 GB
Container: Yes
Shell: 5.8 - /usr/bin/zsh
Binaries:
Node: 12.22.0 - /usr/bin/node
npm: 7.15.0 - /usr/bin/npm
npmGlobalPackages:
netlify-cli: 3.34.0
Expected behavior
I should not get the error "Module did not self-register"
Additional context
- Issue does not occur once deployed to Netlify.
- The issue happens not just on my Linux machine, but also on MacOS.
- Happens whether I use default bundler or
esbuild. - Happens with npm@6 or npm@7
- Example simple function uploaded to this repo
Much appreciated!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area: command: devarea: redirectstype: bugcode to address defects in shipped codecode to address defects in shipped code