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

Source-map path resolution is broken on Windows #1500

Closed
am11 opened this issue Aug 30, 2015 · 0 comments
Closed

Source-map path resolution is broken on Windows #1500

am11 opened this issue Aug 30, 2015 · 0 comments

Comments

@am11
Copy link
Contributor

am11 commented Aug 30, 2015

While requesting latest artifacts from AppVeyor yesterday, I realized that some source-map path related tests were failing on Windows which are passing on Linux (and even Windows when switched back to libsass v3.2.0 stable, i.e. node-sass current master).

TravisCI build: https://travis-ci.org/am11/node-sass/jobs/77901212
AppVeyor build: https://ci.appveyor.com/project/am11/node-sass/build/702

Step to repro:

In PowerShell:

git clone -b request-ci-artifacts https://github.com/am11/node-sass
cd node-sass

git submodule update --init --recursive
# currently pointing to tip of libsass master

npm install
node scripts/build -f

mkdir /temp
notepad /temp/blah.scss

# enter:
# a{b:c}
# save and close

node
# in node REPL
r = require('./').renderSync({file:'/temp/blah.scss', outFile: '/temp/blah.css', sourceMap: true})

r.css.toString()
r.map.toString()

Yields:

'a {\n b: c; }\n\n/*# sourceMappingURL=C:/temp/blah.css.map */'

(sourceMappURL is absolute path, which is incorrect)

and

'{\n\t"version": 3,\n\t"file": "C:/temp/blah.css",\n\t"sources": [\n\t\t"C:/temp/blah.scss"\n\t],\n\t"mappings": "AAAA,C
AAC,CAAA;EAAC,CAAC,EAAC,CAAE,GAAE",\n\t"names": []\n}'

(file path and those in sources array are absolute, which is again incorrect)

Repeated ditto steps on Ubuntu (with sudo -i and switch notepad with nano); received the desired output:

'a {\n b: c; }\n\n/*# sourceMappingURL=blah.css.map */'

and

'{\n\t"version": 3,\n\t"file": "blah.css",\n\t"sources": [\n\t\t"blah.scss"\n\t],\n\t"mappings": "AAAA,CAAC,CAAA;EAAC,CA
AC,EAAC,CAAE,GAAE",\n\t"names": []\n}'

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