-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 line numbers off by two with no plugins #926
Comments
Thanks for investigation. Yeap, Right now I am preparing for conference and will be free after Dec 11. Could it wait until this date? Maybe I will have time on next week. |
@ai Yep that's fine, just wanted to make sure that it was logged somewhere. |
Hello! Just wondering if there have been any updates on this? :) |
Sorry, I am in other project. Because we had no other reports and problem is not critical this issue is low priority right now. Do you want to try to fix it by your own? I will help you. |
No worries. It's not critical enough for me right now to focus time on fixing it, but if I ever come around to it I'll hit you up to ask for tips on where to look to fix it :) Thanks |
FWIW, I can see evidence of this too. |
Be prepare that this issue will not be fixed for few months:
|
I am always open for PR ;) |
@ai What do you mean by pure PostCSS stack? Weback plugin? |
I mean do all CSS work inside PostCSS: linting, preprocessing, prefixes, postprocessing |
Ah so it's a result of incompatibility between other sourcemaps and PostCSS' sourcemaps then? |
Yeap this issue happen when you have previous source map |
Of course, it is a error and I will fix it. PostCSS should update others source map. |
No worries! Just trying to understand better :) |
+1 |
@subicura I will look into it again after React London (March 28) |
@ai Thanks!! |
I tried few changes but had no success. PostCSS source maps are good. Sass source maps are good. Problem comes from mozilla’s Since Sass compatibility is not goal for PostCSS, I will close this issue (anyway I don’t know solution right now). Possible solutions:
|
@ai Could you please help me reproduce the issue without
body {
background: #ddd;
}
div {
width: 100px;
height: 100px;
margin: auto;
background: #666;
}
But after
I want to file a bug to Well, my case might be a little off compared to this issue, but certainly related. |
What is a problem with this mapping? PostCSS generates less nodes, so result mapping is smaller |
Let the author speak for himself:
Also, I'm curious what makes P.S. I'm going to check if OP's issue still holds. |
...By the way, it might be the root cause of this issue. |
I now see. Regarding OP's test case. IMO nothing is broken in the "after" source map (as well as in the "before" one). Then, these days the issue can't be reproduced (line numbers off by two). Or line numbers are simply off by one consistently across the whole stylesheet. At least in Chromium 63.0.3239.132. From what I can see, Chromium takes the first mapping after the opening curly bracket. Regarding my test case, I was wondering why so much less mappings was left after Now then, what does "apply" here mean again? We have source code ( |
Hey all,
I've encountered a bit of an issue with sourcemaps. My workflow is that I first compile my SASS code down to CSS, and then use PostCSS on the resulting code / source maps.
My problem is that even with no plugins, after going through PostCSS, source map line numbers are off by 2 (they point to 2 lines before the actual line).
This is the input CSS and input source map generated from SASS:
As can be seen on source-map-visualization everything is still linked properly.
Now running them through PostCSS without plugins with this code:
Results in the following output:
Which, we can observe on source-map-visualization, is broken. The
a
selector has no corresponding line number.The text was updated successfully, but these errors were encountered: