You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 24, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Jul 24, 2024. It is now read-only.
nested styles refer to top-level parent in sourcemap line number #1206
i'm having an issue where my nested styles' sourcemap line number in chrome is referencing the top-most parent selector line and not the line that the nested selector starts.
body {
h1 {
background: #f00;
}
}
will show file.scss:1 instead of file.scss:2 for the h1
i've tried outputting the map file to a separate file and embedding it, all the same.
i just added some sample code in an already existing file. the devtools image shows core.scss:5, the parent of the h1, instead of 6, where the h1 selector starts.
@mgreter am i not understanding how the sourcemapping is supposed to work? if it's working as intended, then ok, but i had someone online say their node-sass was showing the nested line number instead of the nested selector's parent line number =/
looks like latest node-sass beta is doing the same thing as before. @mgreter i was under the impression that the sourcemapping would show the line of the actual selector, not its topmost parent. is showing the line number for the topmost parent of the tag the intended result? like i said when i first opened this issue, i've seen nested style with sourcemapping show the line of the actual selector, not its topmost parent..
just ran a test with the latest ruby sass and it's sourcemapping nested children on the child's line and not the top-most parent like it should be. this is definitely a bug and isn't working as intended.
@xzyfer any thoughts? trying to figure out if this is a libsass issue and i should open an issue on their repo or if this is node-sass specific... definitely an issue that needs addressing!
just tested on node-sass v3.5.0-beta.1 and confirm sourcemap line numbers are referring to correct selector! thank you SO MUCH @mgreter !!!!! i'll leave this to be closed by you once the version goes out of beta.
Was this problem occurring only on Chrome or every browser tools with source-map support? Last time I checked (few months ago, while giving a presentation), my sample worked on Chrome, Edge (MSDN) and Firefox (Mozilla hacks). If there is a disparity between what libsass was generating previously and how Chrome is interpreting it, with this fix, it might have broken other browsers. :/
LibSass emits detailed mappings, which many trans-compilers (of JS and CSS) lack including RubySass. @mgreter has nailed this feature! 👍
Activity
xzyfer commentedon Oct 17, 2015
Hi @tehOPEologist, thanks for this issue. @mgreter any thoughts on this one?
mgreter commentedon Oct 17, 2015
Looks ok to me ...
opeologist commentedon Oct 17, 2015
hm, this isn't what's happening for me =/ here's what mine is doing: http://imgur.com/a/WiABA
mgreter commentedon Oct 17, 2015
Why is Body on line 5 in your screenshot??
opeologist commentedon Oct 17, 2015
i just added some sample code in an already existing file. the devtools image shows core.scss:5, the parent of the h1, instead of 6, where the h1 selector starts.
opeologist commentedon Oct 20, 2015
@mgreter am i not understanding how the sourcemapping is supposed to work? if it's working as intended, then ok, but i had someone online say their node-sass was showing the nested line number instead of the nested selector's parent line number =/
opeologist commentedon Oct 23, 2015
@xzyfer any update?
xzyfer commentedon Oct 24, 2015
Not really looking into this at the moment. Have you tried te beta?
On 24 Oct 2015 5:30 am, "Aaron Giordano-Barry" [email protected]
wrote:
opeologist commentedon Oct 24, 2015
didn't see there was a new beta. i'll try that and report back. thanks!
mgreter commentedon Oct 24, 2015
@tehOPEologist @xzyfer I dont see anything wrong with what libsass produces for the given input!
http://libsass.ocbnet.ch/srcmap/#Ym9keSB7CiAgaDEgewogICAgYmFja2dyb3VuZDogI2YwMDsKICB9Cn0=
opeologist commentedon Oct 24, 2015
looks like latest node-sass beta is doing the same thing as before. @mgreter i was under the impression that the sourcemapping would show the line of the actual selector, not its topmost parent. is showing the line number for the topmost parent of the tag the intended result? like i said when i first opened this issue, i've seen nested style with sourcemapping show the line of the actual selector, not its topmost parent..
opeologist commentedon Oct 30, 2015
just ran a test with the latest ruby sass and it's sourcemapping nested children on the child's line and not the top-most parent like it should be. this is definitely a bug and isn't working as intended.
Ruby Sass 3.4.19:
compiles to:
core.css.map:
{ "version": 3, "mappings": "AACE,OAAG;EACD,UAAU,EAAE,GAAG", "sources": ["core.scss"], "names": [], "file": "core.css" }node-sass 3.4.1:
compiles to:
core.css.map:
{ "version": 3, "file": "core.css", "sources": [ "core.scss" ], "mappings": "AAAA,IAAI,CACF,EAAE,CAAC;EACD,UAAU,EAAE,GAAI,GACjB", "names": [] }opeologist commentedon Oct 31, 2015
@mgreter do you see what i mean now with those examples?
opeologist commentedon Nov 4, 2015
@xzyfer any thoughts? trying to figure out if this is a libsass issue and i should open an issue on their repo or if this is node-sass specific... definitely an issue that needs addressing!
17 remaining items
xzyfer commentedon Nov 28, 2015
This has been fixed in LibSass. I'll close this issue when we do a new release with the update LibSass version.
opeologist commentedon Nov 28, 2015
thank you so much all! i'll be patiently waiting for the new node-sass release! :D
HugoHeneault commentedon Dec 2, 2015
Awesome! Can't wait for it!!
ericwooley commentedon Dec 14, 2015
Any updates on this?
tomlagier commentedon Jan 25, 2016
Any updates on this?
opeologist commentedon Jan 29, 2016
just tested on node-sass v3.5.0-beta.1 and confirm sourcemap line numbers are referring to correct selector! thank you SO MUCH @mgreter !!!!! i'll leave this to be closed by you once the version goes out of beta.
mgreter commentedon Jan 30, 2016
Even though it is technically wrong what I did to achieve this (since browsers interpret it not carefully enough IMO), you're welcome 😄
opeologist commentedon Jan 30, 2016
xD thanks again man!
am11 commentedon Jan 30, 2016
Was this problem occurring only on Chrome or every browser tools with source-map support? Last time I checked (few months ago, while giving a presentation), my sample worked on Chrome, Edge (MSDN) and Firefox (Mozilla hacks). If there is a disparity between what libsass was generating previously and how Chrome is interpreting it, with this fix, it might have broken other browsers. :/
LibSass emits detailed mappings, which many trans-compilers (of JS and CSS) lack including RubySass. @mgreter has nailed this feature! 👍
@mgreter, note that what I used in WebEssentials2013 for VS-IDE preview window was based on https://github.com/mozilla/source-map (which is probably used in Firefox tools implementation as well), so it might interpret the line numbers differently. Last I remember, line and col number were off by one (line was 0-based and col was 1-based or vice versa), viz the typical:
Thank you so very much nonetheless. 😎
mgreter commentedon Jan 30, 2016
@am11 these links might be of interest:
ggedde commentedon Sep 10, 2017
I am still having this issue on FIrefox.
There is another open issue for this that might clarify why this is happening: #2092
SweetsXob commentedon Jul 10, 2019
This problem does not seem to be solved now.
It seems less doesn't have this problem