Skip to content

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

Open
@longhotsummer

Description

@longhotsummer

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions