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.

Better error logging on the console

See original GitHub issue

I’m wondering if it’s possible to get better Sass error reporting on the command line during a brunch watch process?

Here’s my brunch-config:

SRC = 'source'
DIST = 'public'
BROWSERSUPPORT = ['last 2 versions','ie >= 9']

exports.config =
    conventions:
        ignored: [
            /[\\/]_/,
            /(^vendor\/phpunit)[\\/]/
        ]
    paths:
        public: DIST
        watched: [
            SRC
            'vendor'
        ]
    npm:
        enabled: true
        globals:
            $: 'jquery'
            jQuery: 'jquery'
            _: 'underscore'
    files:
        javascripts:
            joinTo:
                'js/main.js': /^source/
                'js/vendor.js': /^node_modules/
            order:
                before: [
                    'node_modules/jquery/dist/jquery.js'
                ]
        stylesheets:
            joinTo:
                'css/main.css': SRC + '/styles/main.scss'
    plugins:
        babel:
            presets: ['es2015']
        sass:
            options:
                debug: 'comments'
                mode: 'native'
                includePaths: [
                    'node_modules/foundation-sites/scss'
                    'node_modules/motion-ui/src'
                    'node_modules/family.scss/source/src'
                ]
        postcss:
            processors: [
                require('autoprefixer')(browsers: BROWSERSUPPORT)
            ]
        fingerprint:
            # Mapping file so your server can serve the right files
            manifest: './public/assets.json'
            publicRootPath: '/'
        overrides:
            production:
                optimize: true
                sourceMaps: false
                plugins:
                    autoReload:
                        enabled: false
                    cleancss:
                        keepSpecialComments: 0
                        removeEmpty: true
                    uglify:
                      mangle: false
                      compress:
                        global_defs:
                          DEBUG: false

This is the current error logging I’m getting during a watch:

01 Nov 16:10:30 - error: Compiling of source/styles/main.scss failed.  

With no further info… I’m using the 7-1 pattern which means I have a ton of Sass files—and I need to know which file is causing the error…

Have I uncovered a bug or is it user error?

Thanks!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
shvaikaleshcommented, Dec 14, 2016

Hello @Slakinov, thanks for bringing this up. Will publish new patch version ASAP.

1reaction
alancwoocommented, Dec 24, 2016

@shvaikalesh I’m on brunch 2.9.1 and sass-brunch 2.9.0 and I’m still getting a cryptic error: Compiling of app/scss/core.scss failed.

Have I done something wrong?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to console.log an error with stack trace in node.js?
First, don't use console.log for logging. It's not horrible, but you can do much, much better. My favorite is to use morgan as...
Read more >
12 Ways to Improve Your DevTools Console Logging
12 Ways to Improve Your DevTools Console Logging · 1. Output variable names with ES6 destructuring assignment · 2. Use appropriate log message...
Read more >
JavaScript Error Logging - LogRocket
The best way to optimize JavaScript error logging systems is to use a tool like LogRocket. LogRocket automatically captures all JavaScript errors from...
Read more >
Better console.logs - DEV Community ‍ ‍
Here are a few ways you could make your logs a bit more visually informative, and interesting. Use console.error() for error logs.
Read more >
Best Practices for Client-Side Logging and Error Handling in ...
In this article, we'll discussed methods of improving the default console logger, sending logs to a server, building error boundaries in ...
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