-
Notifications
You must be signed in to change notification settings - Fork 472
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
Build fails with v3.8.0+ - Module parse failed: Unexpected token #2498
Comments
I'm having some trouble replicating this issue, but this seems to be a bug that was recently reported to aws-sdk aws/aws-sdk-js-v3#4146 when you updated the sdk it might have pulled a new version of
|
I am reproducing this issue using a Nuxt 2 project. Webpack is unable to load the This issue occurs for me in both |
@justinIs sorry for the delay, but I think I have reproduced and root caused the issue. I will also provide a solution for you so that the build succeeds. Will require confirmation on your side whether this helps and mitigates your issue to unblock upgrading to latest v3 version for Issue reproductionI created a sample app using Nuxt2 following your linked installation guide. These are the only changes I made to the app to test importing something from JS SDK and I reproduced the issue:
This is the
Then I tried to just bundle the app using
Nuxt2 issue root cause analysisThe error mentioned above is basically due to optional chaining operator ( That meant the underlying bundling is not able to convert or bundle the optional chaining operator usage. Based on this further checked that Nuxt2 framework is using Webpack 4 under the hood for bundling. Upon going through Webpack and Nuxt2 issues, found that Webpack4 depends on To mitigate, tried adding
And this got the Next steps:Could you please confirm whether above provided solution helps your case? Not sure whether you got the same error, but I am able to successfully build the JS SDK into a Nuxt2 app as expected now. |
…ion to FAQ Esbuild issue: evanw/esbuild#2692 Nuxt2/Webpackv4 issue: #2498 (comment)
…ion to FAQ (#2533) Esbuild issue: evanw/esbuild#2692 Nuxt2/Webpackv4 issue: #2498 (comment)
@devalevenkatesh yes adding the |
Glad it worked, resolving this issue now. Request you to open a new issue if you face any issue or have other questions. |
Upgrading from Webpack v4 to v5 solved the issue for me. |
webpack: 4.46.0 I am getting this error:
|
The issue has returned for me as well, same info as @dragos-boisteanu |
I was able to resolve this with the following nuxt build config: (Note the addition of the @ prefix, and the @smithy package namespace which seems to be where AWS have been keeping some of their core shared js dependencies.
|
What happened and what did you expect to happen?
Build works fine with v3.7.0 but after upgrading to v3.8.0 or v3.9.0, I get the following error:
Creating an optimized production build...
Failed to compile.
./node_modules/@aws-sdk/util-endpoints/dist-es/lib/index.js 1:9
Module parse failed: Unexpected token (1:9)
File was processed with these loaders:
You may need an additional loader to handle the result of these loaders.
Have you reviewed our existing documentation?
Reproduction steps
npm i amazon-chime-sdk-js@3.8.0
npm run build
relevant packages in use:
webpack@4.42.0
babel-loader@8.1.0
Amazon Chime SDK for JavaScript version
3.8.0
What browsers are you seeing the problem on?
This is in CLI
Browser version
n/a
Meeting and Attendee ID Information.
n/a
Browser console logs
n/a
The text was updated successfully, but these errors were encountered: