-
Notifications
You must be signed in to change notification settings - Fork 45
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
Broken on Windows #22
Comments
Released in v0.8.1. Sorry about that, we're not using Windows here and it didn't occur to anybody to test with it :-/ I'm planning to setup CI on Windows soon, perhaps with Appveyor. |
Sounds great! We don’t test CI on Windows either but we should :-/ |
Wow cool now it is part of create react app? :) |
Yea! |
@chenEdgar it does look like the same issue, but that issue was fixed (and we are now running the test suite on Windows) so it's more likely something unrelated. Perhaps it would be better if you opened a new issue. I'll need more information to see what's going on, did you see this? https://github.com/waysact/webpack-subresource-integrity/blob/master/CONTRIBUTING.md#issues Does it work with the current stable version of webpack-subresource-integrity (0.9.0)? Do you have a way to test on a Unix-ey system (Linux or MacOS perhaps) and see if it works there? Could you add debug output (before this line webpack-subresource-integrity/index.js Line 326 in 6500e51
src and of Object.keys(compilation.assets) ?
|
I had the same problem that was caused by the css file (value: src) missing from the compilation assets (compilation.assets). What I did was that I changed line the plugins index.js:326 to This caused a correct warning in the output: Pull request created |
This however doesn't explain why in my case it is caused by the css file. |
Found the reason why our css was crashing: Log When the filePath (/css\app.xxxx.css) enters hwpAssetPath it comes out as css/app.xxxx.css The bug now being that for some reason compilation.assets has a 'css\\' that is wrong (all js files are in the form js/) causing the hwpAssetPath output not to match with the one found in compilation.assets |
Thanks for investigating with this, @WallRushGO! I think with this info I'll be able to reproduce it. I'll have a closer look at this over the next few days. |
The root cause for us was to use the path.join in ExtractTextPlugin config.build.mapping.styles = './css'
Our fix
|
Ah, good to know, but I'd call this a workaround and not a fix. I'm aiming to release a fix for this soon and you'll be able to go back to using |
I'm using ExtractTextPlugin("styles.css?[contenthash]"); so for me it appears to be searching for styles.css?b201f92da5f06ce3a6eb8816602e1230&cd9dfb6f4017ef825e33 but the compilation.assets dictionary only contains an entry for styles.css?b201f92da5f06ce3a6eb8816602e1230 unsure if this is totally related to this particular issue, but I am running this on windows and it also seems to be css + extract text related as @WallRushGO 's problem was. |
When there is no direct match for an asset path, search for it by comparing normalized paths where the query part is stripped and (on Windows) backslashes are replaced by forward slashes. Closes #22
@WallRushGO @bzbetty both should be fixed in v1.0.3, let me know how it works for you. |
yep works great now. |
We integrated this plugin into Create React App (facebook/create-react-app#1202), and the build breaks on Windows:
To reproduce:
This happens on Windows because the generated compilation assets key contains Windows path separators but Webpack expected a normalized one.
The text was updated successfully, but these errors were encountered: