Unable to use AWS v3 SDK due to error: Identifier 'module' has already been declared
See original GitHub issueEnvironment
Nuxt CLI v3.0.0-rc.3 RootDir: /Volumes/SuperData/Sites/reelcrafter/v2-microservices Nuxt project info:
- Operating System:
Darwin
- Node Version:
v14.19.1
- Nuxt Version:
3.0.0-rc.3
- Package Manager:
yarn@3.0.2
- Builder:
vite
- User Config:
-
- Runtime Modules:
-
- Build Modules:
-
Reproduction
https://stackblitz.com/edit/github-d2pz9b?file=app.vue
Describe the bug
When importing and using classes and functions from the AWS v3 SDK, the following error is thrown when loading the Nuxt app in a browser:
[nuxt] [request error] Identifier 'module' has already been declared
at Loader.moduleStrategy (internal/modules/esm/translators.js:145:18)
at async link (internal/modules/esm/module_job.js:67:21)
Additional context
No response
Logs
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:6
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Identifier 'module' has already been declared - amplify and ...
I added a ~/composables/useBucket.ts file which I used in ~/api . Same error started popping up the next day. After I moved ~/composables/ ......
Read more >Error Handling in Modular AWS SDK for JavaScript (v3)
In this post, we cover how to use it and how it improves the error handling experience. Why did we do it? Previously,...
Read more >Identifier has already been declared Error in JavaScript
The "Identifier has already been declared error" occurs when a variable with the same name has been declared multiple times in the same...
Read more >Node.js v19.3.0 Documentation
A subclass of Error that indicates the failure of an assertion. ... and will throw an error for functions that have not been...
Read more >Identifier "x" has already been declared" - Ep 11 - YouTube
Your browser can't play this video. ... How to fix "Uncaught SyntaxError: Identifier "x" has already been declared " - Ep 11.
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
This is no longer reproducible on latest RC, with the new
vite-node
devBundler (enabled by default): https://stackblitz.com/edit/github-d2pz9b-b9tyjs.I’ve worked around this
module
issue in AWS Amplify by just creating a Nuxt plugin:plugins/graphql.client.ts
Then whenever I want to use the API: