[bug] Cannot find module '@reown/appkit' during Nuxt 3 build
Link to minimal reproducible example
https://github.com/SPARSEKING/Wallet-Connect/blob/main/app.vue
Summary
I encountered an issue with my Nuxt 3 project that uses the @reown/appkit library. The application runs fine in development mode, and the build completes without errors. However, when I try to run the application in production mode, I get the following error:
Expected Behavior: The application should run without errors in the production environment, just as it does in development mode.
Actual Behavior: The application fails in production mode with the error indicating that the module @reown/appkit cannot be found, even though the build completes successfully.
List of related npm package versions
"@reown/appkit": "^1.0.4",
"@reown/appkit-adapter-wagmi": "^1.0.4",
"@wagmi/core": "^2.13.7",
"@web3modal/wagmi": "^5.1.9",
"nuxt": "^3.13.0",
"viem": "^2.21.15",
I'm using Next.js and I'm having the same issue.
I’m facing a similar issue with my Nuxt 3 project as well. Everything works perfectly in development mode, but when I build for production, I get the same error...
I'm using Sveltekit; same issue.
Everything works fine locally, dev and build preview using npm or Vercel CLI.
When I push the code to Vercel the site will build fine with no issues. When I try and load the site I get "500 Internal Error" with the Vercel Logs showing the same error message as the OP.
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/var/task/node_modules/@reown/appkit/dist/esm/src/client.js' imported from /var/task/node_modules/@reown/appkit/dist/esm/exports/react.js at new NodeError (node:internal/errors:405:5) at finalizeResolution (node:internal/modules/esm/resolve:332:11) at moduleResolve (node:internal/modules/esm/resolve:1029:10) at moduleResolveWithNodePath (node:internal/modules/esm/resolve:876:12) at defaultResolve (node:internal/modules/esm/resolve:1255:79) at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:404:12) at ModuleLoader.resolve (node:internal/modules/esm/loader:373:25) at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:250:38) at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:39) at link (node:internal/modules/esm/module_job:75:36) { url: 'file:///var/task/node_modules/@reown/appkit/dist/esm/src/client.js', code: 'ERR_MODULE_NOT_FOUND' }
My packages:
"@reown/appkit": "^1.1.0", "@reown/appkit-adapter-solana": "^1.1.0",
@H2-won for next js ... please check our examples https://github.com/reown-com/appkit/tree/main/examples or create a new issue ticket
https://linear.app/reown/issue/APKT-1322/[bug]-cannot-find-module-reownappkit-during-nuxt-3-build
You guys are throwing a lot of links around, some I don't have access to. Can you update this issue with what's going on? Is there a fix?
please update to latest version to solve the issue
https://linear.app/reown/issue/APKT-1322/[bug]-cannot-find-module-reownappkit-during-nuxt-3-build
where's the solana nextjs example?