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.

Detailled error message when compilation fails?

See original GitHub issue

Description

Even when using brunch watch -d or DEBUG='brunch:*' brunch watch, the compilation issues do not include debug information. Notifications are empty too.

The problem is not specific, a misplaced comma, a missing paren, all kind of typo are concerned.

I have read the docs, search through post and issues, upgraded packages … At this point, I may be missing something obvious. Having used webpack before, it feels a little backwards.

Thanks!

Expected behavior

I’d like some basic details, pretty like like a console error would give, for instance :

% brunch watch -d 
07 Nov 10:58:48 - error: Compiling of app/somefile.js failed.  
Uncaught ReferenceError: foo is not defined - somefile.js:19:12
07 Nov 10:58:49 - info: compiled 239 files into 3 files, copied 36 in 4.2 sec

Webpack actually provides the babel output if need, to point out the failure location with an ^ arrow.

Actual behavior

When brunch watch -d encounters a compilation failure, the error message is lacking some details, such as line/col number. :

% brunch watch -d 
07 Nov 10:58:48 - error: Compiling of app/somefile.js failed.  
07 Nov 10:58:49 - info: compiled 239 files into 3 files, copied 36 in 4.2 sec

Environment

  1. Brunch: 2.9.1
  2. Node: 7.0.0
  3. NPM: 3.5.9
  4. Operating system: linux

package.json contents

  "devDependencies": {
    "auto-reload-brunch": "^2.7.1",
    "autoprefixer": "^6.5.1",
    "babel-brunch": "^6.0.6",
    "babel-cli": "^6.16.0",
    "babel-core": "^6.17.0",
    "babel-preset-es2015": "^6.16.0",
    "babel-preset-react": "^6.16.0",
    "brunch": "^2.9.1",
    "javascript-brunch": "^2.0.0",
    "npm": "^3.10.9",
    "stylus-brunch": "^2.7.2"
  },

brunch config contents

exports.config = {
  conventions: {
    vendor: /(^bower_components|node_modules|^vendor\/app)[\\/]/
  },
  paths: {
    watched: ['app', 'vendor/app', "lib", "templates"]
  },
  files: {
    javascripts: {
      joinTo: {
        'js/libraries.js': /^(?!app\/)/,
        'js/app.js': /^app\//
      }
    },
    stylesheets: {
      joinTo: 'css/app.css'
    }
  },
  plugins: {
    autoReload: {
      delay: 2000
    },
    babel: {
      presets: ['es2015', "react"],
    },
  },
  npm: {
    enabled: true,
    globals: {
      $: 'jquery',
      jQuery: 'jquery'
    }
  },
};

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
jeromenerfcommented, Dec 7, 2016

@paulmillr sorry to ping back on this closed issue but the problem is still there on my setup, once updated :

% grep "brunch\|babel" package.json 
    "auto-reload-brunch": "^2.7.1",
    "babel-brunch": "^6.0.6",
    "babel-cli": "^6.16.0",
    "babel-core": "^6.17.0",
    "babel-preset-es2015": "^6.16.0",
    "babel-preset-react": "^6.16.0",
    "brunch": "^2.9.1",
    "javascript-brunch": "^2.0.0",
    "postcss-brunch": "^2.0.3",
    "stylus-brunch": "^2.7.2"

I am running brunch with the LOGGY_STACKS=true env var set.

Am I missing something obvious? How can I help?

3reactions
jeromenerfcommented, Nov 7, 2016

Nope, nothing. This might be babel-brunch not passing the error message to brunch.

Running babel on the particular file shows the babel style error :

% babel --presets react,es2015 app/form-contract.js 
SyntaxError: app/form-contract.js: Unexpected token (11:17)
  10 |   defaults = {
> 11 |     "ContractID" = contractid,
     |                  ^
  12 |     "Users": initialData.Users,
  13 |     "Parcels": initialData.Parcels
  14 |   };

Read more comments on GitHub >

github_iconTop Results From Across the Web

Compilation error - Wikipedia
Compilation error refers to a state when a compiler fails to compile a piece of computer program source code, either due to errors...
Read more >
PL/SQL compilation fails with no error message - Stack Overflow
The package I was trying to compile had been wrapped. Apparently, you when compiling wrapped packages, you must be logged in as the...
Read more >
Dealing with Error Messages
Compile the code with the command g++ -g -o sieve sieve.cpp. You should see a lot of error messages flying by, too quikcly...
Read more >
Compile Error Messages - IBM
Msg ID Message Text Explanation 1001 no statement to compile The rule is does not contain any statements. 1002 unexpected end of program The rule...
Read more >
How to see errors after compilation. - Oracle Communities
Hi, After you run your script, you execute show errors. Reagrds Salim. select * from user_errors; --Shows all errors, you can filter this...
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