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 maps not working on Windows #28
Comments
To make it work in windows, I replace |
To fix it nicely add this code
to index.js at line 70 ( just before sass.render(opts) ) |
Windows 8, same problem. @jsbuzz's fix didn't help.
|
Correction index.js, did not help, the error as above. |
Windows 8.1 Had to do this in order to make it work. The problem in our setup is that the paths are absolute on Windows while they are relative on Mac, so I had to simply remove the absolute path in order to create relative paths for Windows and just do a replace of slashes just to be sure. function nodeSass (file, cb) {
if (process.platform == "win32") {
file.path = path.relative(".", file.path)
file.path = file.path.replace(/\\/g, "/");
} |
Was having this same problem on Windows 7. |
Any chance quinyx's solution could make it into the official package? It'd be great to not have to edit node modules manually, feels dirty. |
Hey all, I'm new to node and gulp and streams but could you take the nice @quinyx solution and bring it up into the gulpfile like so?
As a workaround it feels less dirty than fiddling with the module directly. |
Hey David, If that works that is the best idea so far. I mean until the fix makes it into the master of course. Cheers! (I already switched to Ubuntu though as a lot of other gulp modules also didn't work on windows...) |
@davidgilbertson Many thanks for this... certainly, editing the core gulp-sass module was dirty, this is a much better solution (temporary as it may be until the fix makes it into the master). @jsbuzz Might I ask if you went with a native Ubuntu install or a VM setup? I'm currently considering a new setup, so I'm looking at different options and curious about what's working for other developers. |
@IsaacEG No problems. |
@IsaacEG I have a native Ubuntu with a boot manager next to my win7 - I kept it for office activities and intensive IE testing. But I really like the Ubuntu so I'll stick with it for now. After setting up the nvidia driver all works great, before that it was crappy though. |
@davidgilbertson wonderful solution thanks! I've implemented that into our project and it seems to work very well and it's a pretty clean fix. It's worth noting that your fix requires a small require to one's gulp file (one that's super useful anyway) |
@davidgilbertson your solution works like a charm! Thank you so much. |
A little update, I was using it in a few tasks so I've DRYed it out a little so that each task only needs
|
There is a pull request which fixes this problem much more elegantly: #45 |
In regards to the update from @davidgilbertson, it's making my sass task fail silently and breaking the watch task on a syntax error. I've got Removing the processWinPath function and any referencing to sourcemapping fixes the issue. |
@Jarrydcrawford Yes, I had the same issues with @davidgilbertson's solution. So I switched to this pull request which works fine. But, unfortunately, it is not updated accordingly to gulp-sass (it is not the latest version now). |
I found another solution for the path problem. Just add the
But it anyway fails silently if soureMap option is enabled and there is a syntax error in scss styles. Update. It worked for me for some time but now it doesn't for some reason. This is really weird. Can anyone test if it helps? |
@web2style I tried the pull request from #45 which works great with |
This is so weird. I used gulp-ruby-sass, which needs So doesn't everybody (I mean windows users) use source maps? I just want to use foundation in my project, so sass is the only option. Gulp-ruby-sass is unreally slow (takes 7 seconds to compile my project vs 500ms with gulp-sass). But I can't use source maps with gulp-sass and this is absolutely useless without it. This is so sad. Any ideas? |
This is no longer relevant since gulp-sass has switched to using gulp-sourcemaps |
Passing the option
sourceComments: 'map'
causes the following error:undefined:3
"file": "D:\gulp\Styles\variables.scss",
^
SyntaxError: Unexpected token g
at Object.parse (native)
at opts.success (D:\gulp\node_modules\gulp-sass\index.js:43:20)
Changing the value to 'normal' does work though.
Running gulp in Windows 8.1 using PowerShell.
The text was updated successfully, but these errors were encountered: