fix(docs-infra): correctly detect chunk load errors (#43088)
It seems that at some point (potentially with the switch to Webpack 5) Webpack started using the full chunk name (instead of just a numeric identifier) in `ChunkLoadError` messages. So the error messages changed from: ``` ChunkLoadError: Loading chunk 2 failed. ``` ...to: ``` ChunkLoadError: Loading chunk src_app_something_some_module_ts failed. ``` This commit updates the regex that is used to detect such errors (in order to print ServiceWorker-related debug info) to correctly recognize the new error message format. PR Close #43088
This commit is contained in:
parent
bbad42310b
commit
6c3ad1f1a4
|
@ -149,7 +149,7 @@ export class DocViewerComponent implements OnDestroy {
|
|||
this.setNoIndex(true);
|
||||
|
||||
// TODO(gkalpak): Remove this once gathering debug info is no longer needed.
|
||||
if (/loading chunk \d+ failed/i.test(errorMessage)) {
|
||||
if (/loading chunk \S+ failed/i.test(errorMessage)) {
|
||||
// Print some info to help with debugging.
|
||||
// (There is no reason to wait for this async call to complete before continuing.)
|
||||
printSwDebugInfo();
|
||||
|
|
Loading…
Reference in New Issue