-
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
Update source-map-support to 0.5.9 to resolve issue with source maps for karma runs (ng test) in v1.7.X #11968
Comments
The use of [email protected] doesn't seem to resolve the main issue. I've installed from scratch my node_modules and after executing my test (ng test), I still have the same issue I have of course the last version of source-map-support Here is my package.json:
|
Important to note that @TitaneBoy is using a newer version of the CLI (6.0.X) than the reported issue here, so I'm not sure what other issues he may be facing. I was only able to verify with the latest 1.6.X and 1.7.X. |
I'm seeing the same error with:
|
Seems related to #7296 |
Please disregard, my problem was self-inflicted... 🤦♂️ |
@arimus we still use Reading through karma-runner/karma#2852 I get the feeling this can happen due to a lot of things. One of them is CORS, and the error message becomes better with the new We should take a look at the examples in karma-runner/karma#2852 and figure out why our error reporting in Angular CLI doesn't show the right error messages. |
@arimus I forgot to say: it's very unlikely that we'll release a patch for 1.x for this, as 6.x is our LTS right now and we only release patches to 1.x for severe security issues. |
|
Any updates on this? It seems to be getting worse the more tests I add. |
Yep, still happening. Will this fix drop in a 6x update or will I have to move to 7? |
Hi all, this might have been solved If the problem persists can you setup a minimal repro please? You can read here why this is needed. A good way to make a minimal repro is to create a new app via This might be related to your directory structure so its really important to get an accurate repro to diagnose this. |
Closing as no reproduction was provided. |
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. |
Bug Report or Feature Request (mark with an
x
)Command (mark with an
x
)Versions
Angular CLI: 1.7.4
Node: 8.9.4
OS: darwin x64
Angular: 5.2.4
Repro steps
When running karma tests, stack traces are hidden when running via the following, unless --source-map=false is specified, however then the line numbers are incorrect:
ng test --config karma.conf.js
The log given by the failure
Stack trace in the console running karma using Chrome:
[object ErrorEvent] thrown
Stack trace in the Chrome browser console:
Failed to load ng:///DynamicTestModule/ShiftDetailCellComponent.ngfactory.js: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https. (anonymous) @ zone.js:2956 polyfills.bundle.js:10484 Uncaught DOMException: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'ng:///DynamicTestModule/ShiftDetailCellComponent.ngfactory.js'. at http://localhost:9876/_karma_webpack_/webpack:/node_modules/zone.js/dist/zone.js:2956:1 at XMLHttpRequest.proto.(anonymous function) [as send] (http://localhost:9876/_karma_webpack_/webpack:/node_modules/zone.js/dist/zone.js:1372:1)
CORS errors due to the mapping issues.
Desired functionality
The recently released version of source-map-support now catches the CORS errors and produces the correct stack trace as one would expect. See:
evanw/node-source-map-support#222
Mention any other details that might be useful
I'm assuming there has to be a big report on this somewhere, but I couldn't find it. There are similar issues under other projects as people have attempted to get to the root of this issue. One of those is:
karma-runner/karma#2852
As mentioned in my post here, I have confirmed that if I delete the bundled version of source-map-support and install the latest as a peer dependency, the issue is resolved. I'm not sure if there are any other issues that may result from a minor version bump and I haven't ran through all of the test suite for @angular/cli to verify yet, but this one issue does appear to be resolved by the new rev.
It didn't appear that source-map-support is still used in 6.0.X of the CLI, so not sure if this is even an issue with newer versions of the CLI. But if this can be packed for us to get a 1.7.5 version of the CLI, that would rock for those of us that want to migrate to a newer rev, but can't yet do so.
Thanks!
The text was updated successfully, but these errors were encountered: