question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SassMiddleware doesn't compile on request

See original GitHub issue

i have the following code, which i imported to run.py. It should compile my *.sass file to css upon reload/request of the webapp but it kinda doesnt work. It doesnt compile my sass files to css upon request. Is there something im missing here? I dont have any errors… Thanks alot!

from flask import Flask
from sassutils.wsgi import SassMiddleware
from myapp.config import Config


def create_app(config_class=Config):
    try:
        app = Flask(__name__)
        app.config.from_object(Config)

        app.wsgi_app = SassMiddleware(app.wsgi_app, {
            'myapp': ('static/sass', 'static/css', '/static/css')
        })

    except Exception as e:
        raise e
    else:
        from myapp.main.routes import main
        app.register_blueprint(main)

        return app

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:18 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
asottilecommented, Aug 7, 2018

it looks like source maps are always on with no way to turn them off. This is probably by design since it’s intended as a developer tool.

The extension thing is the issue I mentioned previously: #55 (an outstanding (imo) bug)

0reactions
maki-markiecommented, Aug 7, 2018

Thanks a lot Anthony! You were a great help… But i think im much better off with sass.compile command.

Read more comments on GitHub >

github_iconTop Results From Across the Web

node-sass-middleware not compiling - Stack Overflow
This is how app.js should be: app.use(sassMiddleware({ src: srcPath, dest: destPath, debug: true, outputStyle: 'compressed' }) ...
Read more >
CSS isn't compiled after the first success? #49 - GitHub
I'm running into a weird issue using this middleware with Express. Here is our usage: var sass = require('node-sass-middleware') ...
Read more >
Node-sass-middleware - npm.io
Note on Patches/Pull Requests · Fork the project. · Make your feature addition or bug fix. · Add documentation if necessary. · Add...
Read more >
node-sass-middleware - npm
Recompile .scss or .sass files automatically for connect and express based http servers. Connect example. var connect = require ...
Read more >
Node-Sass-Middleware attaching /public to the end of paths?
No matter what I do, the /public always gets appended to the end. The declaration is var sassMiddleware = require('node-sass-middleware'); .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found