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

Source Map is generated, loaded by browser (HTTP 200), but does not work. #266

Closed
vgrinko opened this issue Oct 13, 2014 · 10 comments
Closed

Comments

@vgrinko
Copy link

vgrinko commented Oct 13, 2014

Hi everyone,

I am experiencing weird issue with uglify/sourceMap feature.
Generally, source map is generated, loaded by browser (HTTP 200), but does not work (in the "Sources" tab of Chrome, everything still looks minified/uglified). At the same time other sourcemaps (on another project) are working well.

Here is my grunt uglify configuration:

    bootstrap: {
        options: {
            sourceMap: true
        },
        files: {
            'build/bootstraps/bootstrap.js': ['build/bootstraps/bootstrap.js']
        }
    }

what it does is uglify/minify+sourcemap of 1 file (which is located at build/bootstraps/bootstrap.js).
Yes, it uglifies itself (since it is result of multi-step process).
I tried to separate, same result.

Here is what generated:
bootstrap.js:

    !function(a,b){"use strict";var c=.......
    //# sourceMappingURL=bootstrap.js.map

bootstrap.js.map:

    {"version":3,"file":"bootstrap.js","sources":["bootstrap.js"],"names":["global","manifest","Bootstrap","init","require","$",....
    "mappings": "CAAA,SAAWA,EAAQC,GACf,YAGA.....

Can you please suggest any direction where the issue can be?

@cesarvarela
Copy link

I have the same issue, the sourcemaps are being loaded, but chrome isn't making "the connection".

I think this is related to the removal of some options related to custom paths, that now are being calculated automatically.

@vgrinko
Copy link
Author

vgrinko commented Oct 30, 2014

Well, I don't think it is directly related to that change, since I tried on both old and new versions, outcome is the same.

@atav32
Copy link

atav32 commented Jan 27, 2015

+1

Do your maps throw an error when parsed by the BASE64 VLQ CODEC http://murzwin.com/base64vlq.html

Invalid input: Unexpected token v


I've also tried serving .map files as application/json instead of the nginx default (application/octet-stream), but that didn't seem to change anything

@atav32
Copy link

atav32 commented Jan 27, 2015

Or is it related to this issue #270?

@SamVerschueren
Copy link

Experiencing the same issue

Invalid input: Unexpected token v

@smonev
Copy link

smonev commented Mar 11, 2015

Same here:

Invalid input: Unexpected token v

@elsigh
Copy link

elsigh commented Mar 26, 2015

Same here:
Invalid input: Unexpected token v

But I'm using webpack, so this might be a red herring?

@smonev
Copy link

smonev commented Mar 26, 2015

jQuery source map also produces the same error: Invalid input: Unexpected token v so I am exactly sure what we can make of the error.

By the way, my problems were solved by upgrading all my npm modules to the latest versions. So I am not sure what exactly the problem was.

@factoidforrest
Copy link

has anyone figured this out?

@alexlamsl
Copy link
Contributor

There have been fixes to source-map on uglify-js@3, so this may already be addressed.

Please report to https://github.com/mishoo/UglifyJS2/issues with reproducible test case if this is still an issue.

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

8 participants