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:
George Kalpakas 2021-08-09 20:19:40 +03:00 committed by Andrew Kushnir
parent bbad42310b
commit 6c3ad1f1a4
1 changed files with 1 additions and 1 deletions

View File

@ -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();