Skip to content
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

Module parse failed: Unexpected token #2569

Open
mtin79 opened this issue Jan 30, 2023 · 2 comments
Open

Module parse failed: Unexpected token #2569

mtin79 opened this issue Jan 30, 2023 · 2 comments

Comments

@mtin79
Copy link

mtin79 commented Jan 30, 2023

Hi out there,
currently working on an project where i run into the following error which doesn't appear when i run the next server locally.
Only when i deploy it to aws (via npm run serverless --stage production) i get the following error:

Failed to compile.

./node_modules/@aws-sdk/client-dynamodb/dist-cjs/runtimeConfig.js 32:34
Module parse failed: Unexpected token (32:34)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|         runtime: "node",
|         defaultsMode,
>         bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength,
|         credentialDefaultProvider: config?.credentialDefaultProvider ?? (0, client_sts_1.decorateDefaultCredentialProvider)(credential_provider_node_1.defaultProvider),
|         defaultUserAgentProvider: config?.defaultUserAgentProvider ??


> Build error occurred
Error: > Build failed because of webpack errors

Any ideas or hints are much appreciated!

@ykurniawan
Copy link

what nodejs runtime version are you using?

@mtin79
Copy link
Author

mtin79 commented Feb 10, 2023

Hi @ykurniawan ,
locally i am using node 14.20.1 via .nvmrc and package-lock.json is mentioning also node >= 14....

Screenshot 2023-02-10 at 11 07 32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants