You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created a fresh Nuxt project using bun and installed PWA. When I run the application via npm run dev, I get the following error:
ERROR Named export 'defu' not found. The requested module 'defu' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'defu';
const { defu } = pkg;
import { defu } from 'defu';
^^^^
SyntaxError: Named export 'defu' not found. The requested module 'defu' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'defu';
const { defu } = pkg;
at ModuleJob._instantiate (node:internal/modules/esm/module_job:171:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:254:5)
at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:482:26)
at async loadKit (/C:/Users/PROJECT_PATH/node_modules/nuxi/dist/shared/nuxi.f76c700d.mjs:5049:15)
at async Object.run (/C:/Users/PROJECT_PATH/node_modules/nuxi/dist/chunks/dev.mjs:170:32)
at async runCommand$1 (/C:/Users/PROJECT_PATH/node_modules/nuxi/dist/shared/nuxi.fefc5017.mjs:1648:16)
at async runCommand$1 (/C:/Users/PROJECT_PATH/node_modules/nuxi/dist/shared/nuxi.fefc5017.mjs:1639:11)
at async runMain$1 (/C:/Users/PROJECT_PATH/node_modules/nuxi/dist/shared/nuxi.fefc5017.mjs:1777:7)
Running npx nuxi upgrade --foce gives me a different error now:
node:internal/modules/esm/resolve:257
throw new ERR_MODULE_NOT_FOUND(
^
Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'C:\Users\PROJECT_PATH\node_modules\nuxi\dist\shared\nuxi.fefc5017.mjs' imported from C:\Users\PROJECT_PATH\node_modules\nuxi\dist\index.mjs
at finalizeResolution (node:internal/modules/esm/resolve:257:11)
at moduleResolve (node:internal/modules/esm/resolve:914:10)
at defaultResolve (node:internal/modules/esm/resolve:1038:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:554:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:523:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:246:38)
at ModuleJob._link (node:internal/modules/esm/module_job:126:49) {
code: 'ERR_MODULE_NOT_FOUND',
url: 'file:///C:/Users/PROJECT_PATH/node_modules/nuxi/dist/shared/nuxi.fefc5017.mjs'
}
Node.js v22.8.0
I have since upgraded my Node version which was formerly v21.x.
I created a fresh Nuxt project using bun and installed PWA. When I run the application via
npm run dev
, I get the following error:This is my package.json:
My nuxt.config.ts:
I was in the process of migrating an app to a PWA and had started a new project for that purpose to slowly transition all aspects of the app.
The text was updated successfully, but these errors were encountered: