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

node-canvas fails after updating 6.7.0 => 6.8.0 #1112

Closed
tomyam1 opened this issue Oct 6, 2020 · 6 comments
Closed

node-canvas fails after updating 6.7.0 => 6.8.0 #1112

tomyam1 opened this issue Oct 6, 2020 · 6 comments

Comments

@tomyam1
Copy link

tomyam1 commented Oct 6, 2020

Bug Report

After updating 6.7.0 to 6.8.0 I get the following error after requiring https://github.com/Automattic/node-canvas

Error: Module did not self-register.
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1003:18)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Module.require (internal/modules/cjs/loader.js:849:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (c:\code\tepez\node_modules\canvas\lib\bindings.js:3:18)

This is bindings.js:3: https://github.com/Automattic/node-canvas/blob/v2.6.1/lib/bindings.js#L3

I suspect this is due to #1091
Maybe it doesn't clear the module cache correctly?

@dl748 Since you made the commit, can you please take a look?

Locking version at 6.7.0 (without changing anything else) prevents the issue

Environment

  • serverless version: 1.83.0
  • serverless-offline version: 6.8.0
  • node.js version: 12.13.0
  • OS: [e.g. macOS 10.13.4, Windows 10, Ubuntu 16.04]
@dl748
Copy link
Contributor

dl748 commented Oct 6, 2020

Do you have a sample of how you are using it?

@tomyam1
Copy link
Author

tomyam1 commented Oct 6, 2020

Minimal reproduction project at https://github.com/tomyam1/slss-offline-1112

Waths weird is that in the minimal project, serverless-offline version 6.6.0 works and versions 6.7.0 and 6.8.0 don't.
While in our real project 6.7.0 does work and 6.8.0 doesn't.

@dl748
Copy link
Contributor

dl748 commented Oct 6, 2020

I'll need to look further, but it looks like it due to a non javascript module being unloaded.

@amerkay
Copy link

amerkay commented May 14, 2021

Did you ever figure this issue out? Every change to any serverless function results with "Module did not self-register" error. It's not a fun dev env when you need to restart the server and wait a minute every time you hit save.

Thanks

@dl748
Copy link
Contributor

dl748 commented May 16, 2021

Yes

@tomyam1
Copy link
Author

tomyam1 commented Jun 17, 2021

Closing this becaus it's a duplicate of #871

@tomyam1 tomyam1 closed this as completed Jun 17, 2021
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

3 participants