-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Manually added prefixed rules break source map positions #170
Comments
Hmm, these "a few lines off" errors have more significant consequences if you Cmd+click/Ctrl+click in Chrome on a concrete CSS rule; it should redirect you to a proper line but it's not only a few lines off but sometimes in a different place in the file. This may be caused by the same issue. Anyway, clicking on the |
For source map issues I need input/output source and input/output maps. (Source map is very difficult to debug :( ) |
OK, I'll try to create a smaller example then (but I'll need up to a few days for that). |
It seems my intuitive diagnosis might have been correct - after your recent fixes when I removed redundant rules that used to serve as workarounds, mappings now work correctly. I'll try to construct a smaller example soon. |
@ai OK, I found one issue, though it's triggered by mixins, not manually inserted rules. @mixin flex-test {
justify-content: flex-end;
}
#test-elem {
@include flex-test;
font-size: 16px;
color: red;
} HTML: <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div id="test-elem"></div>
</body> Compile it via: sass --sourcemap styles-autoprefixer.scss:styles-autoprefixer.css &&
autoprefixer styles-autoprefixer.css -o styles.css --map Then open Chrome, mark the |
Hmm, no, that issue is caused by not changing the source map annotation comment. (which is a bug, btw, but separate from this one). For the project I use grunt-autoprefixer, though, that puts the proper comment by itself so this issue must have been different. Tough to crack... :/ |
What if you output CSS after Autoprefixer to same file name? |
Source map annotation fix will b released in next version. |
I was definitely seeing the issue when I manually added some prefixed rules in the large project but I can't reproduce it in a simple case... :/ |
Use this source map visualizer to help debugging. |
Feel free to reopen issue if you will have some new information |
I see misplaced source map line mappings in Chrome. They're usually moved only by a couple of lines which makes me think that my workaround for #165 & similar by manually adding a missing/broken rule like:
are not reflected in the final position.
I can try to construct a minimal case if you need it, @ai, but I thought that maybe it would be obvious for you where the problem lies so I haven't tried yet. Let me know if you need it. :)
The text was updated successfully, but these errors were encountered: