web-infra-dev / rspack

A fast Rust-based web bundler πŸ¦€οΈ

Home Page:https://rspack.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Panic occurred at runtime without backtrace

uncaught opened this issue Β· comments

System Info

System:
OS: Linux 5.15 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
CPU: (12) x64 AMD Ryzen 5 5600X 6-Core Processor
Memory: 13.92 GB / 15.59 GB
Container: Yes
Shell: 5.1.16 - /bin/bash
Binaries:
Node: 20.5.1 - /usr/bin/node
npm: 9.8.0 - /usr/bin/npm
pnpm: 9.0.6 - /usr/bin/pnpm

Details

I'm trying to migrate a slightly older project to rsbuild, but the process panics and does not give any further details on what is wrong:

DEBUG=rsbuild rsbuild dev
  Rsbuild v0.6.8

debug   12:50:49 add default plugins
debug   12:50:49 add default plugins done
debug   12:50:49 init plugins
debug   12:50:50 init plugins done
debug   12:50:50 modify Rsbuild config
debug   12:50:50 modify Rsbuild config done
debug   12:50:50 create dev server
debug   12:50:50 modify bundler chain
debug   12:50:50 modify bundler chain done
debug   12:50:50 modify Rspack config
debug   12:50:50 modify Rspack config done
debug   12:50:50 create compiler
  > Local:    http://localhost:3000/
  > Network:  http://172.23.195.234:3000/

debug   12:50:50 create compiler done
debug   12:50:50 create dev server done
debug   12:50:50 listen dev server
debug   12:50:50 Use Rspack v0.6.3
start   Compiling...
debug   12:50:50 listen dev server done
success Inspect config succeed, open following files to view the content:

  - Rsbuild Config: /home/nc/tmp/doko/packages/client/build/rsbuild.config.mjs
  - Rspack Config (web): /home/nc/tmp/doko/packages/client/build/rspack.config.web.mjs

Panic occurred at runtime. Please file an issue on GitHub with the backtrace below: https://github.com/web-infra-dev/rspack/issues
Message:  content should be available
Location: /build/crates/rspack_loader_runner/src/runner.rs:446

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
Run with RUST_BACKTRACE=full to include source snippets.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
<empty backtrace>
Aborted

The repository is public: https://github.com/uncaught/doko/tree/d25849ea4d30630b8e7080eee81bbd715e2fc5de/packages/client

Tried on WSL (Windows 11), but also on a Ubuntu 22 server with the same result.

Reproduce link

https://github.com/uncaught/doko/tree/d25849ea4d30630b8e7080eee81bbd715e2fc5de/packages/client

Reproduce Steps

git clone --branch upgrade_2024-05 git@github.com:uncaught/doko.git
cd doko
git checkout d25849ea4d30630b8e7080eee81bbd715e2fc5de
cd packages/client
npm install
npm run dev
commented

Message: content should be available
same issue #6290

commented
// case 1 typicall happens on migrating from other builders
import "virtual:uno.css"
// case 2 and 3
import * as NodeFS from "node:fs" // target: "web"
import * as BunFS from "bun:fs" // target: "web"

Thanks for your contributing. You can check whether your source code or dependencies meet the above cases.

close this first and traking it in #6290

@SoonIter I have not a single colon in any of my imports and I get <empty backtrace>!

That does not look like what is happening in #6290.

Did you reproduce my case and see that this is the exact same issue? Because I'm still in the dark on what is happening and I cannot resolve this. I have to go back to webpack now.

So please re-open this

I have some more information I found after continuing my updates (using webpack in the meantime):

The error occurs with "fomantic-ui-css": "2.8.8". After upgrading that dependency to 2.9.*, rsbuild runs without errors.

While this solves my build, you should probably still investigate into why your bundler crashes without a stack trace.

commented

Sorry for the rude close. I debug this issue more carefully.

This error message reason is related to the wrong parsing of the module url.

just a semicolon

image
/* 2.8.8 */

@font-face {
  font-family: 'Step';
  src: url(data:application/x-font-ttf;charset=utf-8;;base64,AAEAAAAOAIAAAwBgT1MvMj3hSQEAAADsAAAAVmNtYXDQEhm3AAABRAAAAUpjdnQgBkn/=)
      format('truetype'),
    url(data:application/font-woff;base64,d09GRgABAAAAAAqgABAAAAAAEXwAAQ=)
      format('woff');
}

/* 2.9.0 */

@font-face {
  font-family: 'Step';
  src: url(data:application/font-woff;base64,d09GRgABAAAAAAqgABAAAAAAEXwAAQ=)
    format('woff');
}

This error message has been optimized and aligned with webpack in #6404.

image image

So far, I think this issue will be solved in the upcoming version, so I decided to close it again. If there are any problems, please feel free to reopen it :D