Skip to content

[Bug]: Panic occurred on next-rspack building, Message: slice index starts at 1 but ends at 0 #10003

@lonelam

Description

@lonelam

System Info

System:
OS: Linux 5.15 Ubuntu 22.04.5 LTS 22.04.5 LTS (Jammy Jellyfish)
CPU: (16) x64 AMD Ryzen 7 2700X Eight-Core Processor
Memory: 50.92 GB / 58.86 GB
Container: Yes
Shell: 5.1.16 - /bin/bash
Binaries:
Node: 23.7.0 - ~/.nvm/versions/node/v23.7.0/bin/node
Yarn: 1.22.22 - ~/.nvm/versions/node/v23.7.0/bin/yarn
npm: 10.9.2 - ~/.nvm/versions/node/v23.7.0/bin/npm
pnpm: 10.3.0 - ~/.nvm/versions/node/v23.7.0/bin/pnpm

Details

Hi, I just tried rspack plugin in my next app, and encountered a panic without any information.

To preproduce this, I have left a branch for reproducing the issue: https://github.com/lonelam/subconverter-rs/tree/rspack-crash
Maybe there should be more information on the panic cases.

The build output:

laizn@lais-desktop:~/codes/subconverter-rs/vercel$ RUST_BACKTRACE=full pnpm build

subconverter-next@0.1.0 build /home/laizn/codes/subconverter-rs/vercel
next build

▲ Next.js 15.3.0 (Rspack)

Creating an optimized production build ...
next-rspack is currently experimental. It's not an official Next.js plugin, and is supported by the Rspack team in partnership with Next.js. Help improve Next.js and Rspack by providing feedback at vercel/next.js#77800
Panic occurred at runtime. Please file an issue on GitHub with the backtrace below: https://github.com/web-infra-dev/rspack/issues
Message: slice index starts at 1 but ends at 0
Location: crates/rspack_plugin_javascript/src/visitors/dependency/context_dependency_helper.rs:55

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Reproduce link

https://github.com/lonelam/subconverter-rs/blob/rspack-crash/vercel/next.config.ts

Reproduce Steps

  1. cd vercel
  2. pnpm install
  3. pnpm build

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions