Skip to content

[Panic]: "init_from_json_schema" is not in any chunk, which is unexpected #9651

@ibodev1

Description

@ibodev1

Panic message

$ pnpm build
$ node --env-file-if-exists=.env node_modules/rolldown/bin/cli.mjs -c rolldown.config.ts
Rolldown panicked. This is a bug in Rolldown, not your code.

thread '<unnamed>' (25092) panicked at crates\rolldown\src\module_finalizers\mod.rs:512:13:
SymbolRef { owner: 52, symbol: SymbolId(91) } "init_from_json_schema" is not in any chunk, which is unexpected
Rolldown panicked. This is a bug in Rolldown, not your code.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Please report this issue at: https://github.com/rolldown/rolldown/issues/new?template=panic_report.yml

thread '<unnamed>' (4308) panicked at crates\rolldown\src\module_finalizers\mod.rs:512:13:
SymbolRef { owner: 52, symbol: SymbolId(91) } "init_from_json_schema" is not in any chunk, which is unexpected

Please report this issue at: https://github.com/rolldown/rolldown/issues/new?template=panic_report.yml
Rolldown panicked. This is a bug in Rolldown, not your code.

thread '<unnamed>' (2312) panicked at crates\rolldown\src\module_finalizers\mod.rs:512:13:
SymbolRef { owner: 52, symbol: SymbolId(91) } "init_from_json_schema" is not in any chunk, which is unexpected
Rolldown panicked. This is a bug in Rolldown, not your code.

thread '<unnamed>' (4308) panicked at crates\rolldown\src\module_finalizers\mod.rs:512:13:
SymbolRef { owner: 52, symbol: SymbolId(91) } "init_from_json_schema" is not in any chunk, which is unexpected

Please report this issue at: https://github.com/rolldown/rolldown/issues/new?template=panic_report.yml

Please report this issue at: https://github.com/rolldown/rolldown/issues/new?template=panic_report.yml
Rolldown panicked. This is a bug in Rolldown, not your code.

thread '<unnamed>' (2312) panicked at crates\rolldown\src\module_finalizers\mod.rs:512:13:
SymbolRef { owner: 52, symbol: SymbolId(91) } "init_from_json_schema" is not in any chunk, which is unexpected
Rolldown panicked. This is a bug in Rolldown, not your code.

thread '<unnamed>' (41592) panicked at crates\rolldown\src\module_finalizers\mod.rs:512:13:
SymbolRef { owner: 52, symbol: SymbolId(91) } "init_from_json_schema" is not in any chunk, which is unexpected

Please report this issue at: https://github.com/rolldown/rolldown/issues/new?template=panic_report.yml
Rolldown panicked. This is a bug in Rolldown, not your code.

thread '<unnamed>' (2312) panicked at crates\rolldown\src\module_finalizers\mod.rs:512:13:
SymbolRef { owner: 52, symbol: SymbolId(91) } "init_from_json_schema" is not in any chunk, which is unexpected

Please report this issue at: https://github.com/rolldown/rolldown/issues/new?template=panic_report.yml
Rolldown panicked. This is a bug in Rolldown, not your code.

thread '<unnamed>' (7460) panicked at crates\rolldown\src\module_finalizers\mod.rs:512:13:
SymbolRef { owner: 52, symbol: SymbolId(91) } "init_from_json_schema" is not in any chunk, which is unexpected

Please report this issue at: https://github.com/rolldown/rolldown/issues/new?template=panic_report.yml
Rolldown panicked. This is a bug in Rolldown, not your code.

thread '<unnamed>' (41592) panicked at crates\rolldown\src\module_finalizers\mod.rs:512:13:
SymbolRef { owner: 52, symbol: SymbolId(91) } "init_from_json_schema" is not in any chunk, which is unexpected

Please report this issue at: https://github.com/rolldown/rolldown/issues/new?template=panic_report.yml

Please report this issue at: https://github.com/rolldown/rolldown/issues/new?template=panic_report.yml
Rolldown panicked. This is a bug in Rolldown, not your code.

thread '<unnamed>' (41592) panicked at crates\rolldown\src\module_finalizers\mod.rs:512:13:
SymbolRef { owner: 52, symbol: SymbolId(91) } "init_from_json_schema" is not in any chunk, which is unexpected
Rolldown panicked. This is a bug in Rolldown, not your code.
Rolldown panicked. This is a bug in Rolldown, not your code.

thread '<unnamed>' (39944) panicked at crates\rolldown\src\module_finalizers\mod.rs:512:13:
SymbolRef { owner: 52, symbol: SymbolId(91) } "init_from_json_schema" is not in any chunk, which is unexpected
Rolldown panicked. This is a bug in Rolldown, not your code.

thread '<unnamed>' (4384) panicked at crates\rolldown\src\module_finalizers\mod.rs:512:13:
SymbolRef { owner: 52, symbol: SymbolId(91) } "init_from_json_schema" is not in any chunk, which is unexpected
Rolldown panicked. This is a bug in Rolldown, not your code.

Please report this issue at: https://github.com/rolldown/rolldown/issues/new?template=panic_report.yml

thread '<unnamed>' (4308) panicked at crates\rolldown\src\module_finalizers\mod.rs:512:13:
SymbolRef { owner: 52, symbol: SymbolId(91) } "init_from_json_schema" is not in any chunk, which is unexpected

thread '<unnamed>' (7460) panicked at crates\rolldown\src\module_finalizers\mod.rs:512:13:
SymbolRef { owner: 52, symbol: SymbolId(91) } "init_from_json_schema" is not in any chunk, which is unexpected
Rolldown panicked. This is a bug in Rolldown, not your code.

thread '<unnamed>' (2312) panicked at crates\rolldown\src\module_finalizers\mod.rs:512:13:
SymbolRef { owner: 52, symbol: SymbolId(91) } "init_from_json_schema" is not in any chunk, which is unexpected
Rolldown panicked. This is a bug in Rolldown, not your code.

thread '<unnamed>' (31956) panicked at crates\rolldown\src\module_finalizers\mod.rs:512:13:
SymbolRef { owner: 52, symbol: SymbolId(91) } "init_from_json_schema" is not in any chunk, which is unexpected
Rolldown panicked. This is a bug in Rolldown, not your code.

thread '<unnamed>' (25092) panicked at crates\rolldown\src\module_finalizers\mod.rs:512:13:
SymbolRef { owner: 52, symbol: SymbolId(91) } "init_from_json_schema" is not in any chunk, which is unexpected
Rolldown panicked. This is a bug in Rolldown, not your code.

thread '<unnamed>' (12332) panicked at crates\rolldown\src\module_finalizers\mod.rs:512:13:
SymbolRef { owner: 52, symbol: SymbolId(91) } "init_from_json_schema" is not in any chunk, which is unexpected

Please report this issue at: https://github.com/rolldown/rolldown/issues/new?template=panic_report.yml

Please report this issue at: https://github.com/rolldown/rolldown/issues/new?template=panic_report.yml

Please report this issue at: https://github.com/rolldown/rolldown/issues/new?template=panic_report.yml

Please report this issue at: https://github.com/rolldown/rolldown/issues/new?template=panic_report.yml

Please report this issue at: https://github.com/rolldown/rolldown/issues/new?template=panic_report.yml

Please report this issue at: https://github.com/rolldown/rolldown/issues/new?template=panic_report.yml

Please report this issue at: https://github.com/rolldown/rolldown/issues/new?template=panic_report.yml

Please report this issue at: https://github.com/rolldown/rolldown/issues/new?template=panic_report.yml

 ERROR  Panic in async function                                                                                                                                                                                                                                   

  

[ELIFECYCLE] Command failed with exit code 1.

Reproduction

Private Project

System Info

System:
    OS: Windows 11 10.0.26200
    CPU: (12) x64 AMD Ryzen 5 5625U with Radeon Graphics         
    Memory: 20.01 GB / 39.31 GB
  Binaries:
    Node: 24.16.0 - C:\nvm4w\nodejs\node.EXE
    npm: 11.13.0 - C:\nvm4w\nodejs\npm.CMD
    pnpm: 11.5.1 - C:\Users\***\AppData\Local\pnpm\pnpm.CMD
    bun: 1.3.12 - C:\Users\***\.bun\bin\bun.EXE
    Deno: 2.7.14 - C:\Users\***\.deno\bin\deno.EXE
  Browsers:
    Edge: Chromium (147.0.3912.60)
    Internet Explorer: 11.0.26100.8115
  npmPackages:
    rolldown: ^1.1.0 => 1.1.0

Additional context

Hello,

I wasn’t experiencing this issue in Rolldown version 1.0.1, but as soon as I updated to 1.0.2, it started occurring in all subsequent versions. The issue identified by the Claude AI agent is believed to be caused by the JSON-from-schema API feature in the ZOD and LangChain packages, so the following setting was added to the Rolldown configuration.

  treeshake: {
    // Zod v4 + LangChain: keep these side-effectful, else Rolldown's finalizer panics
    // ("init_from_json_schema is not in any chunk", rolldown 1.0.2–1.1.0) and at runtime
    // drops PURE-annotated Zod class constructors ("Class is not a constructor").
    moduleSideEffects: [
      { test: /(^|[\\/])(zod|@langchain|langchain)([\\/]|$)/, sideEffects: true },
      { external: true, sideEffects: true },
    ],
  },

When I add this to the config, the build completes without any issues and the bundle file works. I can’t provide a source link because the code is in a private repository.

The RollDown versions where I encountered the issue: 1.0.2 - 1.0.3 - 1.1.0

Metadata

Metadata

Assignees

No one assigned

    Type

    Priority

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions