I’m encountering a MIME type error with a web worker in my Angular application using esbuild. The worker fails to load in Firefox with the following error:
While Chrome doesn’t show the error, the worker still doesn’t function properly there either.
Angular Version:18
Builder: @angular-devkit/build-angular:browser-esbuild
-
Start the Angular development server
-
Open the application in Firefox
- Check the console to see the MIME type error for the worker file:
“https://developer.x.com:11111/Viewer/@fs/C:/Projects/Viewer/RViewer/.angular/vite-root/RViewer/decodeImageFrameWorker.js?worker_file&type=module”
worker was prevented from loading due to an unauthorized MIME type (“text/html”).
The issue occurs with the decodeImageFrameWorker.js web worker