Module did not self-register/Unable to load module when I change any files

Hi,

I’m having an odd issue.

Any time I change any file inside my netlify/functions/ folder, the node-canvas module and jsdom modules fail to load. I have to stop the netlify dev function and restart.

I get this error loading PaperJS, Unable to load jsdom module. Same error for node-canvas module triggered by any file change.

Am I missing something?

Thank you!

Edit: The node-canvas error is:
Module did not self-register: '/home/kay/devel/9amim/node_modules/canvas/build/Release/canvas.node'

@amer Just to verify, the name of your folder is actually .netlify/functions/ right, and not netlify/functions/ ?

That’s the URL. The URL is http://localhost:8888/.netlify/functions/func-name, yes.

The JS files are in the folder (relative to root of my project), like /netlify/functions/func-name/index.js.

Defined in netlify.toml as functions = "netlify/functions" as per the docs.

Hey there, @amer :wave:

Welcome to the Netlify Forums, and thanks for reaching out! It looks like this thread has been a bit quiet since you last posted. Are you still encountering this error? If you are, please share your Netlify site name as well as any steps you have taken since last week, and I will loop in a Support Engineer :slight_smile:

Hey,

Yes, I’d love some help resolving this. Site name is 9amim.

Please note, this is a netlify dev issue, and it does not happen in production.

Thanks :slight_smile:

hi there amer, thanks for sharing that. As this is a netlify dev specific issue, the best way for you to get some assistance is to review the issues on GitHub - netlify/cli: Netlify Command Line Interface and if nothing fits, please do file a new one!

Thanks! Just posted a detailed bug report with simple code to reproduce:

1 Like

Hi @amer, thank you for reporting this issue.

We have a fix pending review in fix(command-dev): use decache instead of clearing the entire cache by erezrokah · Pull Request #2681 · netlify/cli · GitHub.

I’ll update once it’s released

1 Like

Hi :wave: This is fixed and released in v3.37.33.

You can update by running npm install -g netlify-cli.

1 Like

Thanks! That’s awesome. I’ll update and check it out.

2 Likes

Oh yeahhhh!! Fixed. That’s going to make life easier.

Thanks a bunch!

2 Likes