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

WARNING in webpack-subresource-integrity: Cannot determine asset for chunk scripts, computed="undefined", available=scripts.2b355891e0dd05f2cdd5.js. #104

Closed
atifsaddique211f opened this issue Feb 4, 2019 · 17 comments

Comments

@atifsaddique211f
Copy link

atifsaddique211f commented Feb 4, 2019

 ng build --prod --subresource-integrity

                                                                                   
Date: 2019-02-04T14:48:54.230Z
Hash: e8ec25d629e6dd81be68
Time: 119010ms
chunk {0} runtime.76b8cb0dd56312a4d1c7.js (runtime) 2.66 kB [entry] [rendered]
chunk {1} main.36a8afa8424de3afa8ad.js (main) 4.45 MB [initial] [rendered]
chunk {2} polyfills.c6cdf1b91f8032c61d53.js (polyfills) 97.4 kB [initial] [rendered]
chunk {3} styles.51c1ea8fe537fad875ea.css (styles) 283 kB [initial] [rendered]
chunk {4} 4.ecbabf05799fd4bb45c2.js () 3.48 kB  [rendered]
chunk {5} 5.a5a29fb287559e9f39b1.js () 3.63 kB  [rendered]
chunk {scripts} scripts.2b355891e0dd05f2cdd5.js (scripts) 950 kB [entry] [rendered]

`WARNING in webpack-subresource-integrity: Cannot determine asset for chunk scripts, computed="undefined", available=scripts.2b355891e0dd05f2cdd5.js. Please report this full error message along with your Webpack configuration at https://github.com/waysact/webpack-subresource-integrity/issues/new`

"@angular/cli": "7.3.0",
 "@angular/core": "7.2.3",
Node : v10.4.1
@jscheid
Copy link
Collaborator

jscheid commented Feb 5, 2019

Thanks, could you share your Webpack config as well, perhaps in a Gist?

@atifsaddique211f
Copy link
Author

@jscheid Here is the content of webpack.config.js in my project root.

module.exports = { node: { path: true, crypto: true, fs: 'empty' } }

@jscheid
Copy link
Collaborator

jscheid commented Feb 5, 2019

Thanks. Which version of this plugin (webpack-subresource-integrity) are you using?

@atifsaddique211f
Copy link
Author

I am not using it directly, I think its a part of Angular CLI 7.3.0
https://github.com/angular/angular-cli

@jscheid
Copy link
Collaborator

jscheid commented Feb 5, 2019

What does this output?

yarn list | grep webpack-subresource-integrity

or if you're using npm

npm list | grep webpack-subresource-integrity

@atifsaddique211f
Copy link
Author

│ └─┬ [email protected] npm ERR! peer dep missing: @angular/animations@^6.0.0, required by [email protected] npm ERR! peer dep missing: @angular/common@^6.0.0, required by [email protected] npm ERR! peer dep missing: @angular/core@^6.0.0, required by [email protected] npm ERR! peer dep missing: @angular/forms@^6.0.0, required by [email protected] npm ERR! peer dep missing: [email protected] - 3, required by [email protected] npm ERR! peer dep missing: popper.js@^1.14.6, required by [email protected] npm ERR! peer dep missing: [email protected] - 3, required by [email protected] npm ERR! peer dep missing: popper.js@^1.12.3, required by [email protected]

@jscheid
Copy link
Collaborator

jscheid commented Feb 5, 2019

Ok, you need to upgrade it. Try npm upgrade webpack-subresource-integrity and make sure it gives you the latest version (1.3.2).

@atifsaddique211f
Copy link
Author

okay, sure,
I try.
Thanks

@atifsaddique211f
Copy link
Author

It don't upgrade like that, I think its a part of some sub dependency, and it is not getting upgrade like that from project root.

@jscheid
Copy link
Collaborator

jscheid commented Feb 5, 2019

Right, it's because angular depends on an older version of this plugin, which I believe they do because they disagree with #90.

You could work around it by switching to yarn and specifying an override. The following might work but I haven't tested it:

{
  "resolutions": {
    "webpack-subresource-integrity": "^1.3.2",
  }
}

I'm going to close this because the only thing I could do to help is revert #91 or maintain a separate branch, and I'd only do that after further discussion (on ticket #90). Please do let me know if the workaround helps, though.

@jscheid jscheid closed this as completed Feb 5, 2019
@atifsaddique211f
Copy link
Author

@jscheid simple resolution with yarn didn't work.

atifsaddique:CTEMPLAR_FRONTEND atifsaddique$ yarn list | grep webpack-subresource-integrity │ ├─ [email protected] ├─ [email protected]

@jscheid
Copy link
Collaborator

jscheid commented Feb 6, 2019

Thanks. The grep result you've posted doesn't conclusively show that it didn't work, I assume you've tried re-running the build and it ran into the same error again?

@atifsaddique211f
Copy link
Author

atifsaddique211f commented Feb 6, 2019 via email

@jscheid
Copy link
Collaborator

jscheid commented Feb 23, 2019

@atifsaddique211f the upgrade works fine in my test, see https://gist.github.com/jscheid/29dee9816e89a27c71b54fd40719a70f

If it still doesn't work for you I'm happy to take another look. I'll need the following from you:

  • A current copy of your yarn.lock
  • Updated output of ng build
  • Ideally, a repository that demonstrates the issue

@vishalhulawale
Copy link

I am also getting same warning on ng build --prod
I am having **1.1.0-rc.6 ** version of webpack-subresource-integrity.
I tried npm upgrade webpack-subresource-integrity it did not solved this issue.

@jscheid
Copy link
Collaborator

jscheid commented Mar 27, 2019

@vishalhulawale npm upgrade won't work. You need to be using yarn and specify resolutions in package.json as detailed above. See the gist for a working example.

@adarshaj
Copy link

For those that are facing this due to angular, the issue is being sorted out at angular/angular-cli#9338 (essentially the above solution by @jscheid is not updating the dependencies recursively, so the cli package should fix the version in their dependency).

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

4 participants