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.

Production: show more verbose error

See original GitHub issue
  • Laravel Mix Version: 1.0.7
  • Node Version: 6.11.0
  • NPM Version: 3.10.10
  • OS: Ubuntu 16.04LTS

Description:

When there is a small non-breaking syntax error in a JS file, the production options shows an error without much information:

Whoops! We had trouble minifying "public/js/buy.js". Perhaps you need to use mix.babel() instead?

/home/jvalck/tickets-webapp/node_modules/laravel-mix/src/plugins/CustomTasksPlugin.js:66
                    throw e;
                    ^
SyntaxError: Unexpected token: name (image)
    at JS_Parse_Error.get (eval at <anonymous> (/home/jvalck/tickets-webapp/node_modules/uglify-js/tools/node.js:1:0), <anonymous>:86:23)

npm ERR! Linux 4.8.0-36-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "production"
npm ERR! node v6.11.0
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! @ production: `NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ production script 'NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs 
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls 
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/jvalck/tickets-webapp/npm-debug.log

This is the line in wabpack.mix.js:

mix.scripts([resourcesScriptDir+'buy.js'], 'public/js/buy.js');

It would be handy if the error message would be more verbose indicating on what line the script failed.

Steps To Reproduce:

  1. Make a small JS-file with a non-breaking syntax error (so that npm run dev doesn’t fail), for example an ES6 JS-file.
  2. Run npm run production

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7

github_iconTop GitHub Comments

18reactions
JeffreyWaycommented, Jul 10, 2017

At the very top, it does tell you what the problem is:

Whoops! We had trouble minifying “public/js/buy.js”. Perhaps you need to use mix.babel() instead

Your buy.js has ES6+ code I imagine. So you need to use mix.babel() instead.

10reactions
Luc45commented, Feb 2, 2018

It would be nice to be informed which line broke the compilation

Read more comments on GitHub >

github_iconTop Results From Across the Web

Production: show more verbose error · Issue #973 · laravel ...
When there is a small non-breaking syntax error in a JS file, the production options shows an error without much information: Whoops!
Read more >
How to see verbose error logs in the Rails console when ...
In dev, I believe it would show the specific line number of the code where the error occurred. Since this production.log file can't...
Read more >
Enabling full verbose logging - Esri Support
On a production machine, you want to minimize the amount of time full logging is enabled since more logging affects performance. The Application...
Read more >
Read your production Angular Errors like a pro - Medium
Reading production error stack trace​​ Now after we have the information about the error which consists of fileName , lineNumber and columnNumber ...
Read more >
View Verbose Output - Windows drivers - Microsoft Learn
When verbose mode is turned on, some display commands (such as register dumping) produce more detailed output. Every MODULE LOAD operation ...
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