You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ERROR Error: Uncaught (in promise): SecurityError: Failed to construct 'Worker': Script at 'http://assets.daily.xxx.net/xxx.worker.js' cannot be accessed from origin 'http://daily.abc.xxx.net'.
Error: Failed to construct 'Worker': Script at 'http://assets.daily.xxx.net/xxx.worker.js' cannot be accessed from origin 'http://daily.abc.xxx.net'.
🐞 Bug report
Command (mark with an
x
)Is this a regression?
no
Description
Angular 8 support build web worker command, but when the app deploys to CDN with
--deploy-url
, the web worker ts will also loaded from the CDN URL.This will cause cross domain error
It makes that impossible to use web worker with
@angular/cli
in the production environmentAngular CLI should support cross-domain web worker loader with options or by default
worker-plugin
like the code below https://github.com/GoogleChromeLabs/worker-plugin#pluginsor replace
worker-plugin
withworker-loader
which support cross-origin-policyhttps://github.com/webpack-contrib/worker-loader#cross-origin-policy
angular-cli/packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs/worker.ts
Line 13 in 277d4ab
or should give an option to deploy the web worker build out to the assets folder
🔬 Minimal Reproduction
https://angular.io/guide/web-worker
with
ng build --prod --deploy-url
to any CDN url can easily reproduce this error🔥 Exception or Error
🌍 Your Environment
The text was updated successfully, but these errors were encountered: