Title: [app-shell] Doesn't work together with @angular/service-worker: "Error: Hash mismatch (cacheBustedFetchFromNetwork)" (+ explanation, + solution) · Issue #8794 · angular/angular-cli · GitHub
Open Graph Title: [app-shell] Doesn't work together with @angular/service-worker: "Error: Hash mismatch (cacheBustedFetchFromNetwork)" (+ explanation, + solution) · Issue #8794 · angular/angular-cli
X Title: [app-shell] Doesn't work together with @angular/service-worker: "Error: Hash mismatch (cacheBustedFetchFromNetwork)" (+ explanation, + solution) · Issue #8794 · angular/angular-cli
Description: cc: @alxhub @StephenFluin Versions Angular CLI: 1.6.0 Node: 8.2.1 OS: darwin x64 Angular: 5.1.0 ... animations, common, compiler, compiler-cli, core, forms ... http, language-service, platform-browser ... platform-browser-dynamic, platfo...
Open Graph Description: cc: @alxhub @StephenFluin Versions Angular CLI: 1.6.0 Node: 8.2.1 OS: darwin x64 Angular: 5.1.0 ... animations, common, compiler, compiler-cli, core, forms ... http, language-service, platform-brow...
X Description: cc: @alxhub @StephenFluin Versions Angular CLI: 1.6.0 Node: 8.2.1 OS: darwin x64 Angular: 5.1.0 ... animations, common, compiler, compiler-cli, core, forms ... http, language-service, platform-brow...
Opengraph URL: https://github.com/angular/angular-cli/issues/8794
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[app-shell] Doesn't work together with @angular/service-worker: \"Error: Hash mismatch (cacheBustedFetchFromNetwork)\" (+ explanation, + solution)","articleBody":"cc: @alxhub @StephenFluin \r\n\r\n### Versions\r\n```\r\nAngular CLI: 1.6.0\r\nNode: 8.2.1\r\nOS: darwin x64\r\nAngular: 5.1.0\r\n... animations, common, compiler, compiler-cli, core, forms\r\n... http, language-service, platform-browser\r\n... platform-browser-dynamic, platform-server, router\r\n\r\n@angular/cli: 1.6.0\r\n@angular-devkit/build-optimizer: 0.0.35\r\n@angular-devkit/core: 0.0.22\r\n@angular-devkit/schematics: 0.0.41\r\n@ngtools/json-schema: 1.1.0\r\n@ngtools/webpack: 1.9.0\r\n@schematics/angular: 0.1.10\r\n@schematics/schematics: 0.0.10\r\ntypescript: 2.4.2\r\nwebpack: 3.10.0\r\n```\r\n\r\n### Repro steps\r\nGenerate a new app with --service-worker, then generate Universal app, then generate app-shell (if it fails, use workaround from https://github.com/angular/angular-cli/issues/8793) and run in the browser\r\n\r\n\r\n### Observed behavior\r\n\r\nAt /ngsw/state:\r\n```\r\nNGSW Debug Info:\r\n\r\nDriver state: EXISTING_CLIENTS_ONLY (Degraded due to failed initialization: Hash mismatch (cacheBustedFetchFromNetwork): http://localhost:8080/index.html: expected e809040220500c7210a197856aa3ecdf8ddd3618, got 100d6731232af53d7a592198666378360e223ba9 (after cache busting)\r\nError: Hash mismatch (cacheBustedFetchFromNetwork): http://localhost:8080/index.html: expected e809040220500c7210a197856aa3ecdf8ddd3618, got 100d6731232af53d7a592198666378360e223ba9 (after cache busting)\r\n at PrefetchAssetGroup.cacheBustedFetchFromNetwork (http://localhost:8080/ngsw-worker.js:657:27)\r\n at \u003canonymous>)\r\nLatest manifest hash: 0f59e15ff1beb35d4ff048bb6cc056e34917081f\r\nLast update check: 6m4s739u\r\n```\r\n\r\n### Desired behavior\r\nSame run/update SW behavior as with non-app-shell node\r\n\r\n\r\n\r\n### Mention any other details that might be useful (optional)\r\nIt happens because app-shell version of `index.html` generated after the generation of `ngsw.json`, where the hash of `index.html` located. So `ngsw.json` contains an incorrect hash, this is why @angular/service-worker throws this error after checking the integrity. Solution: make `ngsw.json` generation a last step in the flow.\r\n","author":{"url":"https://github.com/webmaxru","@type":"Person","name":"webmaxru"},"datePublished":"2017-12-07T23:11:00Z","url":"https://github.com/angular/angular-cli/issues/8794"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:94383f25-221d-7768-afbe-2a2b2ccf7b3a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AF5C:14F601:124A74E:175B6EA:6B010A26 |
| html-safe-nonce | 28b9aa6e457a22c560604faf38408b318fe60ae1abae4ecc026b0d0283833406 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRjVDOjE0RjYwMToxMjRBNzRFOjE3NUI2RUE6NkIwMTBBMjYiLCJ2aXNpdG9yX2lkIjoiMTIyNTI4NjY1NDQ1ODEzNzEyNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b25ece3568bf802ad99983bf9240e0c22025484229bece2d6e763b1e0004d53f |
| hovercard-subject-tag | issue:280312515 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/8794/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d2da8e63f1d03ccd6ca5cef9d33f1b0ffd862c96a324abc94a4256a92abd91bd/angular/angular-cli/issues/8794 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d2da8e63f1d03ccd6ca5cef9d33f1b0ffd862c96a324abc94a4256a92abd91bd/angular/angular-cli/issues/8794 |
| og:image:alt | cc: @alxhub @StephenFluin Versions Angular CLI: 1.6.0 Node: 8.2.1 OS: darwin x64 Angular: 5.1.0 ... animations, common, compiler, compiler-cli, core, forms ... http, language-service, platform-brow... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | webmaxru |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular-cli git https://github.com/angular/angular-cli.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 36891867 |
| octolytics-dimension-repository_nwo | angular/angular-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36891867 |
| octolytics-dimension-repository_network_root_nwo | angular/angular-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width