[Bug]: Dev server with writeToDisk: true
crashes if "asset/resource" is used for assets imported with query strings
#8676
Labels
bug
Something isn't working
System Info
Details
The dev server, more specifically webpack-dev-middleware, crashes with:
when
writeToDisk: true
, some file is importing an asset using a query string in the end (e.g.?v=2
), and a rule "asset/resource" is used to load that asset.Minimal change necessary to crash a project bootstraped using
yarn create rspack
: tmadeira/rspack-repro-writetodisk@8fce671See the reproduce link and the reproduce steps for details.
Reproduce link
https://github.com/tmadeira/rspack-repro-writetodisk
Reproduce Steps
yarn create rspack
to create rspack project. I selected framework: React, language: TypeScript.yarn install
. Note thatyarn run dev
works just fine.src/App.tsx
to import./App.css?v=2
instead of./App.css
, and editrspack.config.ts
to add adevServer.devMiddleware.writeToDisk: true
and amodule.rules[]: { test: /\.css$/, type: "asset/resource" }
. The changes should look like this: tmadeira/rspack-repro-writetodisk@8fce671yarn run dev
again. This time it will fail with:The text was updated successfully, but these errors were encountered: