-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Closed
Description
Command
build
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
If the web worker imported the geotiff package, the "@angular-devkit/build-angular:application" builder returns an incorrect package name.
Minimal Reproduction
- $ ng new test-web-worker-issue
- $ ng generate web-worker app
- $ npm i geotiff
- $ ng build
Lazy Chunk Files | Names | Raw Size | Estimated Transfer Size
**worker-FZXQPYPZ.js** | app-worker | 90 bytes | 90 bytes
$ cat ./dist/test-web-worker-issue/browser/main-BR5U6VHU.js | grep "new Worker("
}`]});let e=t;return e})();if(typeof Worker<"u"){let e=new Worker(new URL("worker-FZXQPYPZ.js",import.meta.url),
- add geotiff code to web worker
paste tosrc\app\app.worker.ts:
/// <reference lib="webworker" />
import { fromArrayBuffer } from "geotiff";
addEventListener('message', async ({ data }) => {
const buffer = new Uint8Array(data);
const tiff = await fromArrayBuffer(buffer.buffer);
const response = `worker response to ${(await tiff.getImage()).fileDirectory.Software}`;
postMessage(response);
});
- $ ng build
Lazy Chunk Files | Names | Raw Size | Estimated Transfer Size
**chunk-WRYSGSTY.js** | decoder | 112.89 kB | 36.43 kB
...
**worker-7MTC4SGP.js** | app-worker | 28.62 kB | 8.91 kB
8 search js chunk name for call a Worker. We can see wrong name for app-worker "chunk-WRYSGSTY.js"
cat ./dist/test-web-worker-issue/browser/main-TKMJ3323.js | grep "new Worker("
}`]});let e=t;return e})();if(typeof Worker<"u"){let e=new Worker(new URL("chunk-WRYSGSTY.js",import.meta.url),
Exception or Error
No response
Your Environment
Angular CLI: 17.1.2
Node: 20.11.0
Package Manager: npm 10.4.0
OS: linux x64
Angular: 17.1.2
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1701.2
@angular-devkit/build-angular 17.1.2
@angular-devkit/core 17.1.2
@angular-devkit/schematics 17.1.2
@schematics/angular 17.1.2
rxjs 7.8.1
typescript 5.3.3
zone.js 0.14.3
angular.json:
- "builder": "@angular-devkit/build-angular:application"
Anything else relevant?
From "builder": "@angular-devkit/build-angular:browser" this problem does not occur.
Reactions are currently unavailable