Skip to content

@nuxt/content@3.8.2 causes _default is not defined error in Nuxt 4 client bundle after build #3619

@andy820621

Description

@andy820621

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: pnpm@10.22.0
  • Builder: -
  • User Config: compatibilityDate, devtools, modules, i18n, seo, icon, image, content, vite, nitro
  • Runtime Modules: @nuxtjs/seo@3.2.2, @nuxt/content@3.8.2, @nuxtjs/i18n@10.2.0, @nuxt/icon@2.1.0, @nuxt/image@2.0.0, @netlify/nuxt@0.2.11
  • Build Modules: -

Version

v3

Reproduction

https://github.com/andy820621/nuxt-content-bug-repo

Description

  • After running pnpm build && pnpm preview, opening http://localhost:3000 immediately throws a ReferenceError: _default is not defined error 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 like const XHe = _default
  • However, there is no declaration of const/let/var _default anywhere 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/content@3.8.0 there makes everything work fine.

In this minimal reproduction, however, even @nuxt/content@3.8.0 still fails with _default is not defined, and only 3.7.1 produces a working fine build.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions