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

Version 3.1.0 corrupting sourceURL index maps and producing broken javascript #812

Open
longhotsummer opened this issue May 12, 2024 · 0 comments

Comments

@longhotsummer
Copy link

Version 3.1.0 of django-pipeline looks like it is producing JS which isn't valid.

My input JS file has code like this (initial contents of eval() removed for simplicity):

eval("... return range;\n}\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://indigo/./node_modules/dom-anchor-text-position/lib/index.js?");

That is being transformed by django-pipeline into this (note the /# sourceURL at the end should be //# but is now /#):

eval("... return range;\n}\n//# sourceMappingURL=lib/index.js.map\n\n/# sourceURL=webpack:/indigo/node_modules/dom-anchor-text-position/lib/index.js?");

The problem is that /# is now interpreted as a regular expression, not as a comment, which causes the call to eval() to fail, because it's not a valid regex:

/# sourceURL=webpack:/indigo/node_modules/dom-anchor-text-position/lib/index.js?

Reverting to 3.0.0 fixes the problem.

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

No branches or pull requests

1 participant