rspack: [Bug]: update to v0.6.0, "Conflicting order" for css, below v0.6.0 was fine, seem like `newTreeshaking` problem.

System Info

System: OS: macOS 14.4 CPU: (32) x64 13th Gen Intel® Core™ i9-13900KF Memory: 16.90 GB / 32.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 21.6.1 - /usr/local/bin/node npm: 10.2.4 - /usr/local/bin/npm pnpm: 8.15.5 - /usr/local/bin/pnpm Watchman: 2024.03.25.00 - /usr/local/bin/watchman

Details

截屏2024-04-10 13 13 34

Reproduce link

No response

Reproduce Steps

this conflict will make css modules error happen in dev and prod.

And I check my code where error happens, the same css import name import _local from '***/index.css', guess newTreeShaking hasn`t handle this edge case for same import css name in a chunk.

About this issue

  • Original URL
  • State: closed
  • Created 3 months ago
  • Comments: 23

Most upvoted comments

node.global = false can lead to other issues, because there is not global in browser.

You can update to 0.6.1 later, webpack_require.g was fixed by #6183

It’s not related to treeshaking, We just omit css order conflict warnings before, and now we emit these warnings, if you build with webpack, it will emit those warnings too.

Those warnings can occur if some css order behave differently in multiple chunks, for example, entryA imports a.css then b.css, but entryB imports b.css then a.css. And you use splitChunks to make a.css and b.css a single chunk, now you will get those warnings

You can check why the order is incorrect, or if you think the order is okay, you can ignore those warning by setting https://webpack.js.org/configuration/other-options/#ignorewarnings