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

Interoperability with resource hints #179

Open
ivany4 opened this issue Apr 3, 2022 · 3 comments
Open

Interoperability with resource hints #179

ivany4 opened this issue Apr 3, 2022 · 3 comments

Comments

@ivany4
Copy link

ivany4 commented Apr 3, 2022

Compilation breaks when webpack-subresource-integrity is used together with html-webpack-preconnect-plugin that injects <link rel="preconnect" href="..." /> tag. SRI plugin tries to download the given file (which in this case is not a file but origin domain for preconnecting) and fails with a very obscure error:

ERROR in   Error: ENOENT: no such file or directory, open '<output path>  <preconnect origin URL>'
- plugin.ts:374 Plugin.processTag
  [...]/[webpack-subresource-integrity]/plugin.ts:374:5

- plugin.ts:110 
  [...]/[webpack-subresource-integrity]/plugin.ts:110:30

- Array.forEach

- plugin.ts:110 Plugin.handleHwpBodyTags
  [...]/[webpack-subresource-integrity]/plugin.ts:110:10

- index.ts:183 
  [...]/[webpack-subresource-integrity]/index.ts:183:18


 - new Promise

I see the mentions of <link rel="preload"> in the documentation, but not other types.

I realize that other resource hints, described in this document, currently marked as a working draft. But they also work in some browsers: https://caniuse.com/?search=preconnect

Webpack 5.71.0
html-webpack-plugin 5.5.0
webpack-subresource-integrity 5.1.0
html-webpack-preconnect-plugin 1.2.1

This was not a problem with webpack-subresource-integrity v1.

@jscheid
Copy link
Collaborator

jscheid commented Apr 4, 2022

I'll see that I can include a fix for this in the next release. Could you create a demo repository that shows this problem?

@jscheid
Copy link
Collaborator

jscheid commented Apr 4, 2022

@ivany4 never mind, I can put the test case together myself no problem.

@ivany4
Copy link
Author

ivany4 commented Apr 5, 2022

@ivany4 never mind, I can put the test case together myself no problem.

Thanks, much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants