waysact/webpack-subresource-integrity

webpack-subresource-integrity throws warning and the build fails

lorandbv opened this issue · 2 comments

Hello, I receive this warning when running the build:
Warning: webpack-subresource-integrity: Cannot determine asset for chunk scripts, computed="undefined", available=scripts.579a133b2d733cb6e0bc.js.

I can't find the issue or a solution.
The version used is "webpack-subresource-integrity": "^1.5.2".
Angular version is angular 11

I attached the script file in .txt format.

scripts.579a133b2d733cb6e0bc.txt

also here is the package.json content

{
  "name": "my-worldpay-portal-ui",
  "group": "com.worldpay.portal",
  "version": "7.0.0",
  "description": "README.md",
  "keywords": [],
  "private": true,
  "author": "Worldpay MBD Team",
  "main": "index.js",
  "scripts": {
    "build": "ng build --progress --subresource-integrity",
    "build:aws": "node --max-old-space-size=8192 node_modules/@angular/cli/bin/ng build --configuration=aws --progress --subresource-integrity",
    "build:prod": "node --max-old-space-size=8192 node_modules/@angular/cli/bin/ng build --prod --progress --subresource-integrity",
    "lint": "ng lint",
    "ng": "ng",
    "package": "node package_archive.js",
    "start": "node --max-http-header-size=100000 ./node_modules/@angular/cli/bin/ng serve",
    "start:hmr": "node --max-http-header-size=100000 ./node_modules/@angular/cli/bin/ng serve --hmr",
    "svg-sprite": "svg-sprite --config src/dev-assets/svg-sprite/svg-sprite-conf.json src/dev-assets/svg/*.svg && node src/dev-assets/svg-sprite/svg-sprite-embed.js && start src/dev-assets/svg-sprite/svg-sprite-preview.html",
    "test": "node --max-old-space-size=8192 node_modules/@angular/cli/bin/ng test --watch=false --code-coverage",
    "test:watch": "ng test --watch=true --code-coverage"
  },
  "browser": {
    "fs": false,
    "os": false,
    "path": false,
    "stream": false,
    "zlib": false
  },
  "dependencies": {
    "@angular/animations": "^11.0.9",
    "@angular/cdk": "^11.0.4",
    "@angular/common": "^11.0.9",
    "@angular/compiler": "^11.0.9",
    "@angular/core": "^11.0.9",
    "@angular/forms": "^11.0.9",
    "@angular/platform-browser": "^11.0.9",
    "@angular/platform-browser-dynamic": "^11.0.9",
    "@angular/router": "^11.0.9",
    "@ng-bootstrap/ng-bootstrap": "^9.0.0",
    "@ngx-translate/core": "^13.0.0",
    "@ngx-translate/http-loader": "^6.0.0",
    "@wp-private/wp-commons-archiver": "^1.0.26",
    "@wp-private/wp-commons-core": "^1.0.8",
    "bootstrap": "4.3.1",
    "core-js": "3.5.0",
    "cross-env": "^5.2.0",
    "d3": "^3.5.6",
    "d3v5": "npm:d3@^5.16.0",
    "file-saver": "^2.0.5",
    "google-libphonenumber": "3.2.6",
    "moment": "^2.29.1",
    "ng-mocks": "^11.4.0",
    "ng2-pdf-viewer": "^7.0.1",
    "overlayscrollbars": "^1.13.1",
    "primeicons": "^1.0.0",
    "primeng": "^11.1.0",
    "rxjs": "^6.5.2",
    "tslib": "^2.0.0",
    "url-search-params-polyfill": "^8.1.0",
    "webpack-subresource-integrity": "^1.5.2",
    "zone.js": "~0.10.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.1100.7",
    "@angular/cli": "^11.0.7",
    "@angular/compiler-cli": "^11.0.9",
    "@angular/language-service": "^11.0.9",
    "@angularclass/hmr": "^3.0.0",
    "@types/google-libphonenumber": "7.4.17",
    "@types/google.analytics": "0.0.39",
    "@types/jasmine": "~3.10.0",
    "@types/node": "^12.11.1",
    "@types/overlayscrollbars": "^1.12.0",
    "@types/pdfjs-dist": "^2.10.378",
    "@types/webpack-env": "^1.16.0",
    "acorn": "6.1.0",
    "codelyzer": "^6.0.0",
    "express": "^4.16.3",
    "jasmine-core": "~3.10.1",
    "jasmine-spec-reporter": "~5.0.0",
    "karma": "~5.1.1",
    "karma-chrome-launcher": "~3.1.0",
    "karma-cli": "^2.0.0",
    "karma-coverage": "~2.0.3",
    "karma-coverage-istanbul-reporter": "~3.0.2",
    "karma-es6-shim": "^1.0.0",
    "karma-jasmine": "~4.0.0",
    "karma-jasmine-html-reporter": "^1.5.0",
    "karma-verbose-reporter": "0.0.6",
    "recursive-copy": "^2.0.11",
    "rimraf": "^2.6.2",
    "tslint": "~6.1.0",
    "typescript": "4.0.5",
    "webpack": "^4.46.0"
  }
}

Sorry for the late reply. I'm closing this as a duplicate of #141. In short, you need to upgrade to angular-cli 11.2 or newer, or find a way to override the version of this plugin (e.g. using yarn resolutions.)