web-infra-dev / rspack

The fast Rust-based web bundler with webpack-compatible API 🦀️
https://rspack.dev
MIT License
9.17k stars 531 forks source link

[Bug Report]: crates rspack_testing run examples get panic #2140

Closed ssccchh closed 1 year ago

ssccchh commented 1 year ago

System Info

System: OS: Linux 5.15 Ubuntu 20.04.5 LTS (Focal Fossa) CPU: (8) x64 Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz Memory: 4.34 GB / 15.47 GB Container: Yes Shell: 5.8 - /usr/bin/zsh Binaries: Node: 16.18.1 - ~/.nvm/versions/node/v16.18.1/bin/node Yarn: 1.22.19 - ~/.nvm/versions/node/v16.18.1/bin/yarn npm: 8.19.2 - ~/.nvm/versions/node/v16.18.1/bin/npm npmPackages: @rspack/cli: workspace:* => 0.1.0

Details

cargo run --example build-cli -- `pwd`/examples/arco-pro/rspack.config.js --emit

when i run the command, i get a panic

thread 'main' panicked at '`loader` field or `builtin_loader` field in `use` must not be `None` at the same time.'

Do these examples not support building directly through rust?

Reproduce link

No response

Reproduce Steps

  1. pnpm install
  2. pnpm run build:cli:debug
  3. cargo run --example build-cli -- `pwd`/examples/arco-pro/rspack.config.js --emit
ssccchh commented 1 year ago

Can I call rspack's bundle capability directly through rust?

ahabhgk commented 1 year ago

These examples don't support build from rust, for bundle from rust you can checkout /crates/rspack_plugin_asset/tests/fixtures.rs, rspack_testing is only used for test in rust.