Module.js - error cannot find module

My project is experiencing an error, and complaining that module.js cannot find the module ‘safe-buffer’.

I updated all my dependencies, and all it did was change the module it could not find. I also tried rm -rf node_modules, then npm install, but to no avail. Is this an issue that can be fixed at your end? The project was working perfectly yesterday.

Thank you,

1 Like

Hey @alexclifton4, sorry for the bother. running enable-pnpm in the console usually resolves this sort of problem.

Hope this helps!

1 Like

Thank you!
I’ve added that to my mental book of tricks

1 Like

greetings alexclifton4 am having the same issue from my console. that module model.js cannot be found. and i exported and imported it well what could be the problem. permission to invite you to the project.


I haven’t used glitch for ages so I can’t help too much sorry, but the tip above from Cori worked for me 2 years ago.

Try opening the console and typing enable-pnpm.
Hope that helps.

hi cori! :slight_smile:
this sort of can’t-load-module thing has happened to me several times in the last week or so without me having done anything. do you know why it happens? (I flailed around a bunch last time so not sure what fixed it, but this time enable-pnpm did the trick)

It’s something we’re investigating, Adam! Next time it happens (and after you run enable-pnpm to get it back up and running) can you email with the name of the project and a screenshot of the logs? :sparkles:

1 Like

it’s doing it again! :cry:

I’m emailing support but putting it here too in case it helps anyone

project: adam-iot-websockets

    throw err;
Error: Cannot find module 'uid2'
    at Function.Module._resolveFilename (module.js:548:15)
    at Function.Module._load (module.js:475:25)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/rbd/pnpm-volume/6911f859-1e24-4ffd-ac06-135531845202/node_modules/
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
1 Like