-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot run tests using Chrome Dev v55 #2125
Comments
Looking at the network tab in the chrome dev tools, it looks like test.ts was served as a video file - so it's not Chrome's fault. The full response headers for the file were:
|
I would guess that the .ts file should not have been served at all, but a compiled / transpired .js file. So somewhere the compilation of the .ts file is not happening. I've reported this exact issue, but have had no responses to my report. #2031 |
Ah - I didn't see that - the initial description did not have anything to do with the issue - probably why I missed it. |
Note that the tests work fine in both current release (v53) and beta (v54) versions of Chrome, in addition to current release/beta/dev versions of Firefox. |
Having the same problem on Chrome on OS X, Version 55.0.2859.0 dev (64-bit) I don't see the error in Safari, (Safari Technology Preview Release 12 (Safari 9.1.2, WebKit 11603.1.3)) and Safari (Version 9.1.3 (11601.7.8)) So, it does look like a Chrome issue. |
I figured out a work around. In the karma.conf.js file, add:
This tells the Karma server to serve the .ts files with a text/x-typescript mime type. That seems to make it work. |
Seems worthy of a pull-request to me. I'll test it out your proposed patch tomorrow at around UTC 8:00 and report back - but reading over the karma docs, it looks like it should work 😃. |
Your fix works great! |
Cool! So if I can figure the steps to make a pull request I'll do it :) |
I can verify that although it works on Chrome 53, it does show the Content-Type as video: The file seems to be served as |
@zzo do you have any insights here? |
angular/angular-cli#2125 (comment) ``` Refused to execute script from 'http://localhost:9876/base/test/browser/sub_test.ts' because its MIME type ('video/mp2t') is not executable. ```
It's not an issue of |
but what's if I don't use karma, however, such errors in *.ts files like MIME type is not executable are exists too |
FWIW we got this error when moving test files from one directory to another and not updating/adding an entry in the preprocessors array. In other words we updated this: to this: and the error went away. |
I had this error for running webpack with awesome-typescript-loader and karma mime type option in karma conf fixed it:
and webpack config:
typescript config:
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
OS: Windows 10 Version 1607 x64
Chrome: 55.0.2859.0 dev-m (64-bit)
ng --version
. If there's nothing outputted, please runin a Terminal:
node --version
and paste the result here:do on your code? etc.
more information.
Console log:
Chrome console:
I think this was probably caused by: https://codereview.chromium.org/2294283002 - is this a Chrome or angular-cli issue? Obviously .ts is a video container format in addition to the typescript format - so I assume that Chrome is blocking it because it thinks it's a video file rather than a typescript file.
ng test
worked fine in previous (non-webpack) betas with this version of Chrome, assumedly becausetest.ts
was not injected into the runner.The text was updated successfully, but these errors were encountered: