Skip to content
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

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

arins
Copy link

@arins arins commented Dec 27, 2016

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

@novocaine
Copy link
Owner

novocaine commented Dec 27, 2016

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

@arins
Copy link
Author

arins commented Dec 28, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants