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

[Bug] Error: Unsupported source map encoding charset=utf8;base64 #13

Closed
ericnoguchi opened this issue May 11, 2017 · 4 comments
Closed
Assignees
Labels

Comments

@ericnoguchi
Copy link

ericnoguchi commented May 11, 2017

I using gulp sass and In node_modules\scss-tokenizer\lib\previous-map.js
the below function breaks when encoding is data:application/json;charset=utf8;base64

This issue stops the whole build process

    PreviousMap.prototype.decodeInline = function decodeInline(text) {
        var uri = 'data:application/json,';
        var base64 = 'data:application/json;base64,';

        if (this.startWith(text, uri)) {
            return decodeURIComponent(text.substr(uri.length));
        } else if (this.startWith(text, base64)) {
            return _jsBase.Base64.decode(text.substr(base64.length));
        } else {
            var encoding = text.match(/data:application\/json;([^,]+),/)[1];
            throw new Error('Unsupported source map encoding ' + encoding);
        }
    };

Maybe a fix similar to postcss/postcss@215ed88

@ericnoguchi
Copy link
Author

Hi,

Would you like me to submit a pull request for this issue? it is a bit urgent as we now have manually updated the file when doing npm install.

@xzyfer
Copy link
Member

xzyfer commented May 18, 2017 via email

@yavin5
Copy link

yavin5 commented Jun 7, 2017

@ericnoguchi Could you please show us what you changed to fix it?

@ericnoguchi
Copy link
Author

@yavin5

For now I manually used the same fix for postcss/postcss@215ed88 see my first comment, you will have to do this again if you remove node_modules and reinstall.

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

No branches or pull requests

3 participants