-
Notifications
You must be signed in to change notification settings - Fork 5
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
node_modules/@cspotcode/source-map-support/browser-source-map-support.js does not match any file. #30
Comments
i get same issue, on upgrading project to angular 12 and using |
My situation is slightly different but with the same ReferenceError. I see the error because I wrote my karma config in TypeScript, which means karma uses ts-node under the hood to compile the file. If I re-write my config in plain JavaScript, karma skips loading ts-node and there's no error. This began with ts-node version 10.3.0. |
The problem is as I explained that the new ts-node makes use of this new package: https://www.npmjs.com/package/@cspotcode/source-map-support And that |
There's a conversation about this issue, and a new item filed to discuss changes to the matter. |
@cspotcode/source-map-support does not include We didn't want to do If shipping the https://unpkg.com/browse/@cspotcode/source-map-support@0.7.0/ |
That should work in this case. Do you think it would be more work to produce this new file or add a new config option to ts-node to disable replacing source-map-support imports? |
Off-hand I'm not sure, because I don't remember where this browser file comes from. Is it built using rollup or browserify? I don't remember. I bet someone could find out by checking the source at https://github.com/evanw/node-source-map-support/ Adding a ts-node config option would be useful for multiple reasons, not solely for this. The other tickets I linked in TypeStrong/ts-node#1533 are not entirely identical features, but they would share code internally. |
source-map-support uses Browserify to produce the browser version of their library, then it uses the online Google Closure Compiler for minification. So is the intent to re-package the existing @cspotcode/source-map-support source into a 2nd file called browser-source-map-support.js? |
Yes, that's the idea. If I removed anything necessary for the browser build from my fork, then someone creates a PR that re-adds it, gets the build running, and gets the browser tests running. Then we can publish a new release. |
@cspotcode I'm giving this a shot but I'm having trouble enough that I don't really know how to proceed. In my hacky attempt, these are the steps I took to get the bundle created again without build errors:
I added the built file to my own project, but I'm getting |
@pe8ter thanks, sounds like you've made great progress so far. It looks like, when the upstream source-map-support calls We can also add a |
Whoops, forgot to add a link to the upstream code I was looking at: We can do something like |
@cspotcode Still plugging away. I found a few more spots in your fork that could probably use the |
Should we move discussion to a pull request on cspotcode/node-source-map-support? That way I can comment on specific bits of code as you push them. The Wasm stuff is a more performant parser of sourcemaps. I'll put some comments on a PR once you create it. We might be able to pragmatically avoid the wasm parser entirely for the browser. |
Okay. I made this PR. Conversation can move there. |
That PR is closed. There's a lot of background info I'm not up to date on, but I'm happy to help where I can. |
I suddenly started getting these errors after updating the packages in my project:
I went into
node_modules/karma-source-map-support/lib/index.js
and addedconsole.log('smsPath ' + smsPath);
and ran my tests again it printed outsmsPath <snip>node_modules/@cspotcode/source-map-support
. I then went into my lock file and saw that ts-node was depending on@cspotcode/source-map-support
. I then realized that I was running karma under ts-node usingts-node node_modules/karma/bin/karma start karma.conf.js
. I changed this tonode node_modules/karma/bin/karma start karma.conf.js
and now it prints outsmsPath <snip>node_modules/source-map-support
and I can run my tests again without error.@cspotcode/source-map-support
is a rather new package, so it makes sense that this just started recently. But it means that the import code inkarma-source-map-support
needs to be made more robust in order to account for both the@cspotcode/source-map-support
and thesource-map-support
packages existing now.The text was updated successfully, but these errors were encountered: