How to use Artifact Bundles with Angular Service Worker #13449
-
Hi, We are facing some issues when using Artifact Bundles in combination with the Angular (v17) service worker. Injecting the debugId's after the sources have been built will obviously change the hashes of the files. However, the hashes in the ngsw.json file are not updated and the service worker then fails with a hash mismatch error. With the new application builder based on esbuild, we do not want to change the builder to the webpack builder. That leaves the options of actually injecting the debugIds later. But what is the proper approach here? Or is this an unsupported/yet to be supported scenario? Shouldn't the inject operation also update ngsw.json? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Hmm, I think this scenario is pretty much unsupported as of now because it is a bit of a chicken and egg situation. You can use the legacy process though I believe. |
Beta Was this translation helpful? Give feedback.
-
I have found a workaround. This should be mentioned in the sentry angular docs. ngsw-config dist/apps/frontend/browser "apps/frontend/ngsw-config.json"
|
Beta Was this translation helpful? Give feedback.
I have found a workaround. This should be mentioned in the sentry angular docs.
You can regenerate the ngsw.json after the debugIds were injected:
ngsw-config dist/apps/frontend/browser "apps/frontend/ngsw-config.json"
ngsw-config
should be innode_modules/.bin/