Cannot find module 'node:http` on AWS Lambda v14
See original GitHub issueUpgrade from version 3.0
to 3.1
produces a Runtime.ImportModuleError: Error: Cannot find module 'node:http
on AWS Lambda runtime.
Screenshots
Your Environment
software | version |
---|---|
node-fetch | 3.1 |
node | 14 |
Additional context
Looks like node:
prefix for imports added as part of https://github.com/node-fetch/node-fetch/pull/1346 causes this issue. I am happy to submit MR with a revert of this one, but I need to understand the reason why this prefix has been added here on the first place. Can you suport me on this one please @dnalborczyk ?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:16
- Comments:34 (10 by maintainers)
Top Results From Across the Web
Serverless Framework with AWS Lambda error "Cannot find ...
I'm trying to use the Serverless Framework to create a Lambda function that uses open weather NPM module. However ...
Read more >Resolve the "Unable to import module" error for Lambda code ...
I receive the "Unable to import module" error when I try to run my AWS Lambda code in Node.js. Short description. You typically...
Read more >Cannot find module (AWS Lambda Error) [Solved] | bobbyhadz
A complete step-by-step guide on how to solve the "Cannot find module" error when trying to load third party packages in AWS lambda....
Read more >Unable to resolve some modules - node:http [solved]
0 and lock the package version. There is already a GitHub issue on this topic here: Cannot find module 'node:http` on AWS Lambda...
Read more >serverless-offline - npm
Specifically, Lambda currently runs on Node.js v12.x, v14.x and v16.x (AWS Docs), whereas Offline runs on your own runtime where no memory ...
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 FreeTop 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
Top GitHub Comments
100s of 1000s of programmers will have to Google this error, come here, and apply the patch. That seems to be a colossal waste of time.
And esbuild is often used implicitly. I.e. if you use CDK with the NodeJsFunction, it calls esbuild. People might not even know that happens.
the latest
node.js
version onaws
is now14.18.1
and therefore supports thenode:
prefix forcommonjs
.