Skip to content

Improve error display when thrown inside Webpack.config.js #55

Closed
@weaverryan

Description

@weaverryan

When an error is thrown inside WebpackConfig.js, it falls outside of the try-catch used inside of getWebpackConfig() (

webpack-encore/index.js

Lines 372 to 383 in 5ca96e9

getWebpackConfig() {
try {
validator(webpackConfig);
return configGenerator(webpackConfig);
} catch (error) {
// prettifies errors thrown by our library
const pe = new PrettyError();
console.log(pe.render(error));
process.exit(1); // eslint-disable-line
}
). This means the errors are really ugly :). If we're going to prettify the errors (which I like), we should do it also around the methods to WebpackConfig.js. We'll probably need to wrap each method in a try-catch (or do something clever to do this automatically).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions