-
Notifications
You must be signed in to change notification settings - Fork 84
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
Destination CSS file doesn't exist #70
Comments
Hi, can you share an example which is failing? I have just tested https://github.com/andrew/node-sass-example with latest stable Changed: var destPath = __dirname + '/public/styles/'; to: var destPath = __dirname + '/public/new-styles/'; in |
I was doing the exact same thing as the example you've tested with, but I'm not using Connect, I'm using FeathersJS. |
I'm having this on ocassional reloads using the example express code. Is this middleware kind of broken? |
I had the same issue, but then I realised it was just a matter of setting correctry the "prefix" option. here is my working conf : {
src: path.join(__dirname, 'scss'),
dest: path.join(__dirname, 'public', 'styles'),
prefix: '/styles'
} Hope that helps |
I'm having the same issue, here is my middleware code:
I get this on the console:
But the css file is never rendered and the website doesnt recive the file. Here is my dependency list from package.json for more info:
|
@theshadow124, here is how I managed to make your example work: File - var sassMiddleware = require('node-sass-middleware');
var app = require('express')();
var serveStatic = require('serve-static');
var join = require('path').join;
var http = require('http');
var port = process.env.PORT || 8000;
var myPrefix = '/static/css';
var destination = join(__dirname, 'public/css');
// Sass middleware
app.use(sassMiddleware({
/* Options */
src: join(__dirname, 'public/sass'),
dest: destination,
debug: true,
outputStyle: 'compressed',
prefix: myPrefix
}));
// static middleware
app.use(myPrefix, serveStatic(destination));
// start server
http.createServer(app).listen(port); Assuming you have |
I never get the file no matter what, from my above post, it never saves the file even once. I've also made a post on stackoverflow: http://stackoverflow.com/questions/40711155/node-sass-middleware-not-rendering-using-express |
Ok, disregard my comment about destination slug (removed). Here is the example project: smw-test.zip
I was mistaken, we don't need to specify destination slug and static middleware should be configured as |
Great, I'm convinced it is some sort of permission issue at this point, even though I'm on windows. I ran your script, it ran fine, copied and pasted the content of your server file into mine and then it does the same thing. I've checked, the files are NOT read only. I'll keep screwing with it. |
update to my issue, my filename was .sass, I thought this was valid, renaming to .scss fixed the issue |
@NetOperatorWibby, I have tested the current behavior with connect and express multiple times: #70 (comment). Please try reconfiguring feather.js with node-sass-middleware v0.10.x. I am closing this for now. Feel free to reopen or create a new issue (with steps to repro), if you are still getting problems. |
@am11 I'm not using this anymore but I'm glad it works well now! |
Hey everyone,
I would like my Sass files to be compiled to a different folder, not the same folder as my Sass files, but
dest
isn't respected for some reason. Neither isoutFile
. Has anyone else gotten this to work?The text was updated successfully, but these errors were encountered: