Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rspack generates the wrong style sort, In some extreme cases there are error products #4513

Closed
jeromehan opened this issue Nov 2, 2023 · 7 comments
Assignees
Labels
bug Something isn't working pending triage The issue/PR is currently untouched.

Comments

@jeromehan
Copy link
Contributor

jeromehan commented Nov 2, 2023

System Info

System:
OS: macOS 13.5.1
CPU: (8) x64 Apple M1
Memory: 46.91 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 14.21.2 - ~/.nvm/versions/node/v14.21.2/bin/node
npm: 6.14.17 - ~/.nvm/versions/node/v14.21.2/bin/npm
pnpm: 7.30.0 - ~/Library/pnpm/pnpm
Watchman: 4.9.0 - /usr/local/bin/watchman
Browsers:
Chrome: 118.0.5993.117
Safari: 16.6
npmPackages:
@rspack/cli: ^0.3.8 => 0.3.8

Details

In this complex demo, rspack generated incorrect style sorting
The close button did not close correctly
image

But that's right in the webpack
image

so seriously affect the use of production

Reproduce link

https://github.com/jeromehan/rspack-import-demo

Reproduce Steps

  1. pnpm i
  2. npm run dev
  3. npm dev:webpack
  4. browse https://10.242.16.131:8089/#/hello
@jeromehan jeromehan added bug Something isn't working pending triage The issue/PR is currently untouched. labels Nov 2, 2023
@jeromehan
Copy link
Contributor Author

jeromehan commented Nov 2, 2023

@hardfist This products problem is in urgent need of help in locating the problem, Thank you

@jeromehan jeromehan changed the title rspack generates the wrong style sort,In some extreme cases there are error products rspack generates the wrong style sort, In some extreme cases there are error products Nov 2, 2023
@jeromehan
Copy link
Contributor Author

@JSerFeng Can you quickly locate the problem? Thanks

@hardfist
Copy link
Contributor

hardfist commented Nov 3, 2023

@jeromehan even rspack behaves different with webpack here, it doesn't always mean rspack is wrong here, because bundle splitting itself can't guarantee css order,see webpack-contrib/mini-css-extract-plugin#959 (comment), so it's may caused the result of bundle splitting diffs here

@hardfist
Copy link
Contributor

hardfist commented Nov 3, 2023

@JSerFeng when I disable splitChunks, rspack have 2 css chunk why webpack 3 css chunk, which seems weird

@JSerFeng
Copy link
Collaborator

JSerFeng commented Nov 3, 2023

After disabled devFriendlySplitChunks, and default splitChunks, the behavior looks the same with Webpack.

As for the ordering, I'll dig it more later

@jeromehan
Copy link
Contributor Author

jeromehan commented Nov 3, 2023

Looks like it's caused by enabled devFriendlySplitChunks. can dig into it

@hardfist
Copy link
Contributor

hardfist commented Nov 6, 2023

@jeromehan since devFriendlySplitChunks will be deprecated in the future and webpack &rspack behaves the same now, I think this issue can be closed now

@hardfist hardfist closed this as completed Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending triage The issue/PR is currently untouched.
Projects
None yet
Development

No branches or pull requests

3 participants