Repository: angular
Issue: Worker process did not return a WorkResponse
Labels: area: bazel,P5

### Which @angular/* package(s) are the source of the bug?

bazel

### Is this a regression?

Yes

### Description

When building our [library](https://github.com/sbb-design-systems/sbb-angular/tree/14.x) with bazel we're getting the following error during the `ng_package` rule:

https://github.com/sbb-design-systems/sbb-angular/runs/7335481766?check_suite_focus=true

```
[470 / 476] Compiling Angular templates (full devmode) //src/angular/autocomplete:autocomplete; 0s remote-cache, worker ... (3 actions, 2 running)
ERROR: /home/runner/work/sbb-angular/sbb-angular/src/journey-maps/BUILD.bazel:38:11: Bundling types (src/journey-maps/journey-maps_public_index.d.ts) failed: Worker process did not return a WorkResponse:
---8<---8<--- Start of log, file at /home/runner/.cache/bazel/_bazel_runner/ffb965d3[66](https://github.com/sbb-design-systems/sbb-angular/runs/7335481766?check_suite_focus=true#step:7:67)b78d9d290bb95018fa337f/bazel-workers/worker-5-BundlingTypes.log ---8<---8<---
(empty)
---8<---8<--- End of log ---8<---8<---
```

(see e.g. this [link](https://github.com/sbb-design-systems/sbb-angular/runs/7335481766?check_suite_focus=true)).

This happens since about two weeks when updating dependencies (e.g. rxjs to v7.5.6 or zone.js to v0.11.7). Sometimes this error can be solved by re-building and sometimes the bug occurs only after some builds. Therefore I'm not really able to narrow this bug more down.

Thanks for your help!

### Please provide the exception or error you saw

```true
[470 / 476] Compiling Angular templates (full devmode) //src/angular/autocomplete:autocomplete; 0s remote-cache, worker ... (3 actions, 2 running)
ERROR: /home/runner/work/sbb-angular/sbb-angular/src/journey-maps/BUILD.bazel:38:11: Bundling types (src/journey-maps/journey-maps_public_index.d.ts) failed: Worker process did not return a WorkResponse:
---8<---8<--- Start of log, file at /home/runner/.cache/bazel/_bazel_runner/ffb965d366b78d9d290bb95018fa337f/bazel-workers/worker-5-BundlingTypes.log ---8<---8<---
(empty)
---8<---8<--- End of log ---8<---8<---
INFO: Elapsed time: 230.387s, Critical Path: 39.13s
INFO: 559 processes: 28 disk cache hit, 432 internal, 37 linux-sandbox, 1 local, 61 worker.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully
Error: Command failed: bazelisk build src/... --build_tag_filters=-release-package,-prod-showcase
    at checkExecSyncError (node:child_process:828:11)
    at execSync (node:child_process:899:15)
    at exec (/home/runner/work/sbb-angular/sbb-angular/scripts/build.ts:191:26)
    at buildAllTargets (/home/runner/work/sbb-angular/sbb-angular/scripts/build.ts:55:3)
    at Object.handler (/home/runner/work/sbb-angular/sbb-angular/scripts/build.ts:30:22)
    at /home/runner/work/sbb-angular/sbb-angular/node_modules/yargs/build/index.cjs:1:8891
    at j (/home/runner/work/sbb-angular/sbb-angular/node_modules/yargs/build/index.cjs:1:4956)
    at M.handleValidationAndGetResult (/home/runner/work/sbb-angular/sbb-angular/node_modules/yargs/build/index.cjs:1:8860)
    at M.applyMiddlewareAndGetResult (/home/runner/work/sbb-angular/sbb-angular/node_modules/yargs/build/index.cjs:1:9502) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 2271,
  stdout: null,
  stderr: null
}
Error: Process completed with exit code 1.
```


### Please provide the environment you discovered this bug in (run `ng version`)

```true
Angular CLI: 14.1.0
Node: 16.16.0
Package Manager: yarn 1.22.18 
OS: linux x64

Angular: 14.1.0
... animations, bazel, cdk, cli, common, compiler, compiler-cli
... core, elements, forms, language-service, localize
... platform-browser, platform-browser-dynamic, platform-server
... router

Package                          Version
----------------------------------------------------------     
@angular-devkit/architect        0.1401.0                      
@angular-devkit/build-angular    14.1.0                        
@angular-devkit/core             14.1.0                        
@angular-devkit/schematics       14.1.0                        
@angular-devkit/schematics-cli   14.1.0
@angular/dev-infra-private       0.0.0-4b8b706a0cd6ae9bc542fe74417040375239aeeb
@bazel/bazelisk                  1.12.0
@bazel/buildifier                5.1.0
@bazel/buildozer                 5.1.0
@bazel/concatjs                  5.5.2
@bazel/esbuild                   5.5.2
@bazel/ibazel                    v0.16.2
@bazel/jasmine                   5.5.2
@bazel/protractor                5.5.2
@bazel/rollup                    5.5.2
@bazel/runfiles                  5.5.2
@bazel/worker                    5.5.2
@schematics/angular              14.1.0
rxjs                             7.5.5
typescript                       4.7.2

```


### Anything else?

_No response_