Skip to content

Prebundler incorrectly handles JSONs that has "default" as top-level property #22530

Closed

Description

Describe the bug

See reproduction link. The prebundled deps generated locally looks this, resulting in an incorrect accessor pattern for getting the property "default" within the JSON that results in undefined in this case:

Image Image

We ran into this issue last friday as one of our NPM packages contains an JSON that has "default" as top-level property in the JSON, resulting in null exception during local dev serve.

Reproduction

https://stackblitz.com/edit/vitejs-vite-yx2cumr5?file=src%2Fmain.js,src%2Flib.js&terminal=dev

Steps to reproduce

Open the link and check the console for output. You should see the following somewhere in the console:

Image

System Info

System:
    OS: Windows 11 10.0.26100
    CPU: (22) x64 Intel(R) Core(TM) Ultra 9 185H
    Memory: 37.51 GB / 63.45 GB
  Binaries:
    Node: 24.15.0 - C:\Program Files\nodejs\node.EXE
    npm: 11.12.1 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 148.0.7778.179
    Edge: Chromium (142.0.3595.53)
    Firefox: 151.0 - C:\Program Files\Mozilla Firefox\firefox.exe
  npmPackages:
    vite: ^8.0.12 => 8.0.14

Used Package Manager

npm

Logs

No response

Validations

Activity

  1. added
    bug: upstream
    p3-minor-bug
    feat: deps optimizer
    and removed on May 26, 2026
  2. linked a pull request that will close this issuefeat: update rolldown to 1.1.1 #22593on Jun 9, 2026
  3. locked and limited conversation to collaborators on Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug: upstreamfeat: deps optimizerp3-minor-bug

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions