sourcemapped-stacktrace icon indicating copy to clipboard operation
sourcemapped-stacktrace copied to clipboard

now working with https://github.com/benmccallum/AspNetBundling and st…

Open arins opened this issue 9 years ago • 2 comments

If you have a path like /hello/thisismymap then this pullrequest fixes so that it will be handled as well.

arins avatar Dec 27 '16 14:12 arins

Sorry, I don't quite understand what behaviour you are trying to fix - are you able to explain it a bit more?

"/hello/thisismymap" will be treated as a relative path before and after your change

var absUrlRegex = new RegExp('^(?:[a-z]+:)?//', 'i');
absUrlRegex.test("/hello/thisismymap")
>> false

because the lookahead

novocaine avatar Dec 27 '16 16:12 novocaine

I will show you an example where it is working and one case where it is not working.

Here is an example where we use webpack and it actually is working great. That's because the sourcemap URL is relative to the js file. In the js file the sourmapping is defined as follows //# sourceMappingURL=app.987d40dbe9e3073106b0.bundle.js.map and the file can be fetched from https://desktop-rhvpai8.symbrio.com/symbrio_main/symapp/built/app.987d40dbe9e3073106b0.bundle.js.map which the the sourcemapped-stacktrace does correctly! image

Second example here which is not working. This is minified with aspNetbundler image

This is using the sourcemap location which is sort of absolute but without domain and protocol. //# sourceMappingURL=/symbrio_main/bundles/symapp-ordermap

this makes the if branch at line 140 true because of

var absUrlRegex = new RegExp('^(?:[a-z]+:)?//', 'i');
absUrlRegex.test("/hello/thisismymap")
>> false

and causes the URL for the sorucemap to be:

https://desktop-rhvpai8.symbrio.com/symbrio_main/bundles//symbrio_main/bundles/symapp-ordermap

this is wrong the actual sorcemap is located in https://desktop-rhvpai8.symbrio.com/symbrio_main/bundles/symapp-ordermap

With my fix this ignores these kind of URLs and just feteches the absolute URLs.

arins avatar Dec 28 '16 07:12 arins