From 6c3ad1f1a4ad422a218c65b2f0a032dbcdaa1083 Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Mon, 9 Aug 2021 20:19:40 +0300 Subject: [PATCH] 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 --- aio/src/app/layout/doc-viewer/doc-viewer.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aio/src/app/layout/doc-viewer/doc-viewer.component.ts b/aio/src/app/layout/doc-viewer/doc-viewer.component.ts index b1610c7c78..039178436a 100644 --- a/aio/src/app/layout/doc-viewer/doc-viewer.component.ts +++ b/aio/src/app/layout/doc-viewer/doc-viewer.component.ts @@ -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();