-
-
Notifications
You must be signed in to change notification settings - Fork 727
@nuxt/[email protected] causes _default is not defined error in Nuxt 4 client bundle after build #3619
Copy link
Copy link
Open
Description
Environment
- Operating System: Darwin
- Node Version: v22.21.0
- Nuxt Version: 4.2.1
- CLI Version: 3.30.0
- Nitro Version: 2.12.9
- Package Manager: [email protected]
- Builder: -
- User Config: compatibilityDate, devtools, modules, i18n, seo, icon, image, content, vite, nitro
- Runtime Modules: @nuxtjs/[email protected], @nuxt/[email protected], @nuxtjs/[email protected], @nuxt/[email protected], @nuxt/[email protected], @netlify/[email protected]
- Build Modules: -
Version
v3
Reproduction
https://github.com/andy820621/nuxt-content-bug-repo
Description
- After running
pnpm build && pnpm preview, openinghttp://localhost:3000immediately throws aReferenceError: _default is not definederror in the browser console - The exception always originates from a Nuxt-generated client entry chunk (e.g.,
R9RtyYat.js, around line 274 / 21177 lines in the built bundle), which contains code likeconst XHe = _default - However, there is no declaration of
const/let/var _defaultanywhere in the file, causing the bundle to crash before the preview page renders
Additional context
My original project has a more complex Nuxt configuration, and downgrading to @nuxt/[email protected] there makes everything work fine.
In this minimal reproduction, however, even @nuxt/[email protected] still fails with _default is not defined, and only 3.7.1 produces a working fine build.
farnabaz
Metadata
Metadata
Assignees
Labels
No labels