Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

watch and multiple @import generates incorrect sources in source map #1819

Closed
nivekz opened this issue Nov 30, 2016 · 3 comments
Closed

watch and multiple @import generates incorrect sources in source map #1819

nivekz opened this issue Nov 30, 2016 · 3 comments

Comments

@nivekz
Copy link

nivekz commented Nov 30, 2016

When --watch is used with multiple @imports, the sources in source map is incorrect.

Note:

bash-3.2$ node_modules/.bin/node-sass --version
node-sass	3.13.0	(Wrapper)	[JavaScript]
libsass  	3.3.6	(Sass Compiler)	[C/C++]

bash-3.2$ cat foo/parent.scss
@import "child1";
@import "child2";

bash-3.2$ cat foo/_child1.scss
a {
  width: 25%;
}

bash-3.2$ cat foo/_child2.scss
b {
  width: 25%;
}

# After starting the following command, I modified _child1.scss
# Notice that how the second "changed" (possibly incorrectly) detects and responds to parent.css change.

bash-3.2$ node_modules/.bin/node-sass --watch --source-map true ~/workspace/sofa/foo --output ~/workspace/sofa/foo
=> changed: /Users/Kevin/workspace/sofa/foo/parent.scss
Rendering Complete, saving .css file...
Wrote Source Map to /Users/Kevin/workspace/sofa/foo/parent.css.map
Wrote CSS to /Users/Kevin/workspace/sofa/foo/parent.css
=> changed: /Users/Kevin/workspace/sofa/foo/parent.css
Rendering Complete, saving .css file...
Wrote Source Map to /Users/Kevin/workspace/sofa/foo/parent.css.map
Wrote CSS to /Users/Kevin/workspace/sofa/foo/parent.css
^C

# Notice the wrong "sources"
bash-3.2$ cat foo/parent.css.map
{
	"version": 3,
	"file": "parent.css",
	"sources": [
		"parent.css"
	],
	"mappings": "AAAA,AAAA,CAAC,CAAC;EACA,KAAK,EAAE,GAAI,GAAG;;AAEhB,AAAA,CAAC,CAAC;EACA,KAAK,EAAE,GAAI,GAAG;;AAEhB,sCAAsC",
	"names": []
@xzyfer
Copy link
Contributor

xzyfer commented Dec 2, 2016

@nivekz could you please create a small github repo which demos this issue so we can debug it?

@nivekz
Copy link
Author

nivekz commented Dec 24, 2016

I cannot reproduce it any more with the latest version as follows. So I suppose we can close this ticket now.

node-sass	4.1.1	(Wrapper)	[JavaScript]
libsass  	3.4.0	(Sass Compiler)	[C/C++]

@xzyfer xzyfer closed this as completed Dec 28, 2016
@xzyfer
Copy link
Contributor

xzyfer commented Dec 28, 2016

Thanks for the confirmation @nivekz

jiongle1 pushed a commit to scantist-ossops-m2/node-sass that referenced this issue Apr 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants