question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug]: Error: Cannot find module 'fs/promises'

See original GitHub issue

Which Remix packages are impacted?

  • remix (Remix core)
  • create-remix
  • @remix-run/architect
  • @remix-run/cloudflare-workers
  • @remix-run/dev
  • @remix-run/express
  • @remix-run/netlify
  • @remix-run/node
  • @remix-run/react
  • @remix-run/serve
  • @remix-run/server-runtime
  • @remix-run/vercel

What version of Remix are you using?

1.0.4

Steps to Reproduce

Run npx create-remix@latest use netlify option. Deploy to Netlify with Github.

Expected Behavior

Site is live with the same view as running netlify dev.

Actual Behavior

Loading my page displays this error instead.

{
errorType: "Runtime.ImportModuleError",
errorMessage: "Error: Cannot find module 'fs/promises' Require stack: - /var/task/node_modules/@remix-run/node/errors.js - /var/task/node_modules/@remix-run/node/index.js - /var/task/node_modules/@remix-run/netlify/globals.js - /var/task/node_modules/@remix-run/netlify/index.js - /var/task/netlify/functions/server/index.js - /var/task/server.js - /var/runtime/UserFunction.js - /var/runtime/index.js",
trace: [
"Runtime.ImportModuleError: Error: Cannot find module 'fs/promises'",
"Require stack:",
"- /var/task/node_modules/@remix-run/node/errors.js",
"- /var/task/node_modules/@remix-run/node/index.js",
"- /var/task/node_modules/@remix-run/netlify/globals.js",
"- /var/task/node_modules/@remix-run/netlify/index.js",
"- /var/task/netlify/functions/server/index.js",
"- /var/task/server.js",
"- /var/runtime/UserFunction.js",
"- /var/runtime/index.js",
" at _loadUserApp (/var/runtime/UserFunction.js:100:13)",
" at Object.module.exports.load (/var/runtime/UserFunction.js:140:17)",
" at Object.<anonymous> (/var/runtime/index.js:43:30)",
" at Module._compile (internal/modules/cjs/loader.js:999:30)",
" at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)",
" at Module.load (internal/modules/cjs/loader.js:863:32)",
" at Function.Module._load (internal/modules/cjs/loader.js:708:14)",
" at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)",
" at internal/main/run_main_module.js:17:47"
]
}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
SaraVieiracommented, Nov 28, 2021

Hey!

Tried it using AWS_LAMBDA_JS_RUNTIME with nodejs14.x and it works!

Any plans on supporting v16?

1reaction
M0nicacommented, Nov 23, 2021

On local I user 14.16.1 and on Netlify it is 16.13.0. So that should not be a problem right?

Did you set netlify env:set AWS_LAMBDA_JS_RUNTIME nodejs14.x? I had a similar issue deploying to Netlify when I had just set the NODE_VERSION to 14 but not the AWS lambda runtime.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot find module 'fs/promises' Electron JS - Stack Overflow
js file to execute system commands. The problem I have is that when compiling for production with electron I get the following error:...
Read more >
Error: Cannot find module 'fs/promises' · Issue #5584 - GitHub
Problem was that I had node v12.14 installed, which does not seem to have the module fs/promises installed. Node v14 does, so I...
Read more >
How to solve Cannot find module 'fs/promises'? - Medium
Recently, I need to install npm package name of rotating-file-stream. So, install it and start npm run… npm show error like below: Cannot...
Read more >
egg.js bug记录:Error: Cannot find module 'fs/promises'
Error : Cannot find module 'fs/promises'
Read more >
Electron-updater cannot find module 'fs/promises'-node.js
[Solved]-Electron-updater cannot find module 'fs/promises'-node.js ... ImportModuleError) · problem with laravel and vue.js | Error: Cannot find module ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found