exports is not defined is ES module scope - still not working
See original GitHub issueEnvironment
Nuxt project info: 20:15:00
- Operating System:
Darwin
- Node Version:
v16.13.0
- Nuxt Version:
3.0.0-27292434.d68318f
- Package Manager:
yarn@1.22.17
- Bundler:
Vite
- User Config:
build
- Runtime Modules:
-
- Build Modules:
-
Reproduction
https://github.com/sweepy84/nuxt3
Describe the bug
A fresh nuxt3 project fails when installing ‘aws-amplify’ as a plugin.
Replication of Bug
Steps performed
- npx nuxi init nuxt3
- yarn install
- yarn add aws-amplify
- Added ‘amplify.ts’ to /plugins directory
- Added transpiling config to ‘nuxt.config.ts’
- yarn dev
Additional context
I know this was logged here https://github.com/nuxt/framework/issues/1573 and was supposed to be fixed with mlly fix but this did not solve problem for me even with latest fixes!
Logs
exports is not defined in ES module scope
at $id_8b3bdae3 (file://./.nuxt/dist/server/server.mjs:3539:23)
at __instantiateModule__ (file://./.nuxt/dist/server/server.mjs:31429:9)
at __ssrLoadModule__ (file://./.nuxt/dist/server/server.mjs:31376:25)
at ssrImport (file://./.nuxt/dist/server/server.mjs:31401:13)
at $id_d9f142a1 (file://./.nuxt/dist/server/server.mjs:3206:37)
at async __instantiateModule__ (file://./.nuxt/dist/server/server.mjs:31429:3)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:5
- Comments:9 (2 by maintainers)
Top Results From Across the Web
exports is not defined in ES module scope AWS Lambda
I have removed the type: module and used require instead of import , but I keep getting the same problem. Lambda Folder Structure...
Read more >ReferenceError: exports is not defined in ES module scope
Node version: 18. I'm trying to run my project with: node dist/index.js. My tsconfig.json "lib": ["ES5"]. "module": "CommonJS".
Read more >aws lambda - module is not defined in ES module scope
aws lambda - ES6 module error : module is not defined in ES module scope. it is clear that aws nodejs 14. x...
Read more >Exports is not defined in ES module scope #1573 - GitHub
The problem is in my current project but also in a newly created one, so I'm not sending my repo. I also tried...
Read more >exports is not defined in es module scope lambda - You.com
exports is not defined in ES module scope - the reason for this error is that Node.js 18.x runtime is using ECMAScript modules...
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
hi @danielroe - appreciate the response.
However I’m still struggling to understand how I can solve this problem so I can use Amplify (and other libraries) with Nuxt3.
Reading the above, im confused… is the expectation for us to wait for conventions to change across the ecosystem of libraries we use?? Is there a workaround that we can use in the meantime?
I’ve tried using the transpile and alias options with no luck, just within the Amplify package there are a lot of sub packages that I try to add but breaks something else.
Would really appreciate a clear example of how this can be solved with the example repo. Obviously I’m not going to be the only person that has issues with Nuxt3 and AWS Amplify.
Many thanks!
I am having the exact same issue, unable to continue project. Project-breaking bug