rails / webpacker

Use Webpack to manage app-like JavaScript modules in Rails
MIT License
5.31k stars 1.47k forks source link

Improved output on webpack error #3241

Closed pocari closed 2 years ago

pocari commented 2 years ago

When webpack terminates with an error, the reason may not be clear from the stdout and stderr output alone. For example, I could not understand the reason when webpack was killed. (See the before output below). For this reason, when webpack fails, it outputs the status information in addition to the stdout and stderr output. Now, I can notice when webpack is killed. (See the after output below).

output examples

before:

** Execute webpacker:compile
Compiling...
Compilation failed:
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating

after:

** Execute webpacker:compile
Compiling...
Compilation failed:
 ExitStatus: pid 1064 SIGKILL (signal 9)
 Outputs: Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
justin808 commented 2 years ago

@guillaumebriday this one looks good to merge. Safe change.

@pocari Thanks for the contribution! Much appreciated!