-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with Serverless and/or webpack #1414
Comments
Could this be related to #1367? What exact version of Node.js are you running? Are you running on AWS Lambda? |
Hi, sorry I hadn't seen that other issue. Looks like it's the same thing. I'm using Serverless to create the AWS Lambda and telling it to use Node 14 but not a specific version. My issue was local by the way, I hadn't tried deploying it to AWS. I have just tried node-fetch@3.0.0
FWIW, in the end I used Axios and that's worked fine. |
AWS Lambda have upgraded to Node.js 14.18 which should solve that problem, I would recommend you doing the same locally to avoid running into it. Regarding your other error, it seems like whatever bundler/transpiler you are using doesn't understand the private fields notation. This syntax is supported in Node.js 12, 14, and 16 natively which is why we are using it. I would suggest upgrading WebPack and/or Babel in order to solve that |
Hi all.
Trying to use node-fetch inside a Serverless project. Using Webpack as well in order to allow to me ES6 for imports.
The moment I import node-fetch (v3.1.0) I get the following errors when I run
serverless offline
:More errors
There are no errors when I import any other services or files. Having
import fetch from 'node-fetch';
as the top line of the Serverless handler throws the error.Here is my webpack file as well in case that's causing the issue
Node version 14. Happy to provide anything else if I've missed something here.
Thank you, Tom
The text was updated successfully, but these errors were encountered: