[Bug]: Error: Cannot find module 'fs/promises'
See original GitHub issueWhich 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:
- Created 2 years ago
- Comments:12 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hey!
Tried it using
AWS_LAMBDA_JS_RUNTIMEwith nodejs14.x and it works!Any plans on supporting v16?
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.