From 7f67c64be1b84d4927bce882cb37cf323688dccc Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Tue, 28 Aug 2018 22:10:43 +0200 Subject: [PATCH] fix(@angular-devkit/build-angular): fixes cors issues with karma (#11970) Checking the stack trace in the issue one can noticed that the paths for the components are being served via the `webpack://` protocol which is causing a `cors` issue between `http` and `webpack` protocol This PR removed the `webpack` protocol from the `devtoolModuleFilenameTemplate` Closes #11966 --- .../build_angular/src/angular-cli-files/plugins/karma.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/angular_devkit/build_angular/src/angular-cli-files/plugins/karma.ts b/packages/angular_devkit/build_angular/src/angular-cli-files/plugins/karma.ts index 71060d02a5..92f4776ae7 100644 --- a/packages/angular_devkit/build_angular/src/angular-cli-files/plugins/karma.ts +++ b/packages/angular_devkit/build_angular/src/angular-cli-files/plugins/karma.ts @@ -144,6 +144,7 @@ const init: any = (config: any, emitter: any, customFileHandlers: any) => { // Files need to be served from a custom path for Karma. webpackConfig.output.path = '/_karma_webpack_/'; webpackConfig.output.publicPath = '/_karma_webpack_/'; + webpackConfig.output.devtoolModuleFilenameTemplate = '[namespace]/[resource-path]?[loaders]'; let compiler: any; try {