question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PostCSS should support optional charset parameter in inline sourcemaps

See original GitHub issue

According to RFC2397 data:uri scheme may include optional charset parameter for text mime types.

Suppose, we have a generated file with unicode symbols and inlined sourcemap with a specified charset (we want to view it in Chrome DevTools). For example:

.test {
  content: 'привет';
}
/*# sourceMappingURL=data:application/json;charset=utf-8;base64,...*/

Right now if we try to use PostCSS with this file it fails with error:

Error: Unsupported source map encoding charset=utf-8;base64

I think PostCSS should consider optional charset (at least utf-8) and correctly apply previous sourcemap in this case.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
sydneyitguycommented, May 2, 2016

I get an error with “Error: Unsupported source map encoding charset=utf8;base64” NOTE that utf8 instead of utf-8

Changed let utf64 = 'data:application/json;charset=utf-8;base64,'; line to let utf64 = 'data:application/json;charset=utf8;base64,';

temporarily fixed the issue. Do you think this is a common case?

0reactions
sydneyitguycommented, May 2, 2016
Read more comments on GitHub >

github_iconTop Results From Across the Web

PostCSS API
Parses source css and returns a new Root or Document node, which contains the source CSS nodes. // Simple CSS concatenation with source...
Read more >
html/node_modules/postcss ... - GitLab
PostCSS is a tool for transforming CSS with JS plugins. These plugins can support variables and mixins, transpile future CSS syntax, inline images, ......
Read more >
postcss - npm
PostCSS is a tool for transforming CSS with JS plugins. These plugins can support variables and mixins, transpile future CSS syntax, inline images, ......
Read more >
postcss | Yarn - Package Manager
PostCSS is a tool for transforming styles with JS plugins. These plugins can lint your CSS, support variables and mixins, transpile future CSS...
Read more >
postcss -u autoprefixer Error: Unsupported source map ...
I updated the version of postcss l, postcss-cli and autopixer to 8.1.0 which supports utf-8 charset then it started working.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found