Skip to content

Commit 54a3f79

Browse files
feat: add service worker guide for fixing invalid file hashes in ngsw.json
1 parent 3b9796e commit 54a3f79

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: Service Worker
3+
---
4+
5+
## Fixing invalid file hashes in `ngsw.json` after injecting debugIds
6+
7+
if `debugIds` are injected into the chunks of the build, the file hashes in `ngsw.json` become invalid and can no longer be cached by the serviceworker. To resolve this issue, regenerate `ngsw.json` after the `debugIds` have been injected using the following command:
8+
```bash
9+
node_modules/.bin/ngsw-config <dist> <config>
10+
```
11+
12+
* `dist` Path to the built chunk files. The `ngsw.json` with the old hashes should be located there.
13+
* `config` Location of `ngsw-config.json` (should be in project root)

0 commit comments

Comments
 (0)