8000 Cannot find sourceMappingURL, if the file has sourceURL instruction at the end. · Issue #33 · stacktracejs/stacktrace-gps · GitHub
[go: up one dir, main page]

Skip to content

Cannot find sourceMappingURL, if the file has sourceURL instruction at the end. #33

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

Closed
8000
evernikovskiy opened this issue Feb 11, 2016 · 1 comment

Comments

@evernikovskiy
Copy link

The current pattern used to locate sourceMappingURL is:
///[#@] ?sourceMappingURL=([^\s'"]+)\s*$/

It assumes that the line with sourceMappingURL is the last line in the file.
However, some libraries (like RequireJS most likely) append additional information labeled sourceURL at the end of the file so in my case it looks like below (the top of the file has been truncated):


[ng:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng:form{display:block;}.ng-animate-shim{visibility:hidden;}.ng-anchor{position:absolute;}</style>');
//# sourceMappingURL=angular.min.js.map

//# sourceURL=http://localhost:63342/AppRoot/public/libs/js/angular.min.js


In this case the current RegEx pattern does not work.

My temporary fix is to remove $ from the RegEx expression. It is not ideal but it works for me at this point. I hope that this issue will be addressed somehow in a future version.

@eriwen eriwen added the bug label Feb 11, 2016
@oliversalzburg
Copy link
Member

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

No branches or pull requests

3 participants
0