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

@charset insertion produces invalid source maps #879

Closed
jonrimmer opened this issue Feb 5, 2015 · 2 comments
Closed

@charset insertion produces invalid source maps #879

jonrimmer opened this issue Feb 5, 2015 · 2 comments

Comments

@jonrimmer
Copy link

If a file contains an UTF-8 character, then the @charset "UTF-8" line that is inserted is not taken into account by the source map generation, causing every mapping to be one line off. E.g. the following will produce an invalid source map file:

div::before {
  content: '';
}

By itself this is an annoyance, but if the generated file is consumed by another tool, such as Autoprefixer, it plays absolute havoc with the build pipeline's attempts to combine the two generated source maps together, and the resulting map file is unusable.

@mgreter
Copy link
Contributor

mgreter commented Feb 5, 2015

We are aware of the issue and unfortunately source-maps are pretty unreliable in the current state. A lot of refactoring needs to be done to fix all issues related to source-maps. We already started to tackle this, but there is no ETA when this will finally be fixed. In the mean time it might be easier to just remove the charset with another postprocessor if you really need source maps working!?

@jonrimmer
Copy link
Author

Thanks. I can live without sourcemaps if necessary, but with over 100 source .scss files, they're a definite aid to debugging. I'll try stripping out the charset, and make sure the encoding is specified via the HTML or a header.

@mgreter mgreter added this to the 3.3 milestone Mar 2, 2015
@mgreter mgreter self-assigned this Mar 7, 2015
mgreter added a commit to mgreter/libsass that referenced this issue Mar 9, 2015
Fixes sass#879
Should work for all prepended texts (like top-comments)
@mgreter mgreter modified the milestones: 3.2, 3.3 Mar 9, 2015
mgreter added a commit to mgreter/libsass that referenced this issue Mar 9, 2015
Fixes sass#879
Should work for all prepended texts (like top-comments)
@mgreter mgreter closed this as completed in 21ce837 Mar 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants