using vue-dapp with nuxt3 error
See original GitHub issue``/Users/jevan/nuxt3-app/node_modules/@ethersproject/basex/lib.esm/index.js:40` import { arrayify } from “@ethersproject/bytes”; ^^^^^^
SyntaxError: Cannot use import statement outside a module
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1031:15)
at Module._compile (node:internal/modules/cjs/loader:1065:27)
at Object.Module._extensions…js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:190:29)
at ModuleJob.run (node:internal/modules/esm/module_job:185:25)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:281:24)
[vite dev] Error loading external “/Users/jevan/nuxt3-app/node_modules/@ethersproject/basex/lib.esm/index.js”.
at file://./.nuxt/dist/server/server.mjs:12284:286
at async instantiateModule (file://./.nuxt/dist/server/server.mjs:21383:3)
m.default is not a function
at file://./.nuxt/dist/server/server.mjs:10:126
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async renderToString (file://./node_modules/vue-bundle-renderer/dist/index.mjs:247:19)
at async renderMiddleware (file://./.nuxt/nitro/index.mjs:191:20)
at async handle (file://./node_modules/h3/dist/index.mjs:601:19)
`
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
I wasn’t able to get this working with Vite, but managed to get to it working using webpack. There is probably a better way to do this, but for anyone else that is trying to use nuxt3 here is my current set up.
These are the dependencies:
This is the nuxt.config.js
Added in the documentaion, @coxlr thank you a lot!