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

[Bug]: build failed on Windows system. #8601

Closed
ZYanan0129 opened this issue Dec 3, 2024 · 4 comments · Fixed by #8622
Closed

[Bug]: build failed on Windows system. #8601

ZYanan0129 opened this issue Dec 3, 2024 · 4 comments · Fixed by #8622
Labels
bug Something isn't working need more info

Comments

@ZYanan0129
Copy link

System Info

System:
Windows 10
CPU Intel(R) Core(TM) i5-8350U CPU @ 1.70GHz 1.90 GHz
Binaries:
node 16.18.1
npm 8.19.2
Browsers:
chrome 131.0.6778.70
npmPackages:
@rspack/cli: 1.1.2
@rspack/core: 1.1.2

Details

Hello, the same configuration in the project can be built successfully and started on macOS, but it fails to build and start on Windows. The error message located can be referenced as follows:
Image
Image
This application used to be built using webpack,could start normally on both macOS and windows systems.
Thanks ~~

Reproduce link

No response

Reproduce Steps

The output configuration information is as follows:
output: { filename: path.join('./', 'js/[name].[chunkhash:8].js'), chunkFilename: path.join('./', 'js/[name].[chunkhash:8].chunk.js'), }
Thanks ~~

@ZYanan0129 ZYanan0129 added bug Something isn't working pending triage The issue/PR is currently untouched. labels Dec 3, 2024
@LingyuCoder
Copy link
Collaborator

Can you provide the complete code in your picture so that we can determine exactly which character generation error caused it? A repro will be better

@LingyuCoder LingyuCoder added need more info and removed pending triage The issue/PR is currently untouched. labels Dec 3, 2024
@ZYanan0129
Copy link
Author

The first picture is source code from @rspack/cli,and the code marked in red blocks the application build.
return "js\" + chunkId + ".chunk.js";
Our output configuration code is output: { filename: path.join('./', 'js/[name].[chunkhash:8].js'), chunkFilename: path.join('./', 'js/[name].[chunkhash:8].chunk.js'), }
We guess whether it is related to the Windows system path translation.
Thanks ~~

@ZYanan0129
Copy link
Author

it is related to the Windows system path translation,changepath.join to path.posix.join

@LingyuCoder
Copy link
Collaborator

Actually there is a bug here. The win32 path should not lead to generate wrong runtime code of chunk filename runtime module. I will fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need more info
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants