How to make the compilation error message of the react project built by webpack be beautifully displayed on the page?

1. Problem description

the react project built by webpack uses ESlint syntax to detect plug-ins when syntax errors (such as calling undefined functions) fail to compile. At this point, the compilation error message is displayed on the page.
how can compilation error messages be gracefully displayed on the page?

2. What result do you expect? What is the error message actually seen?

actually see the result: the compilation error page style is very ugly (white words on black background), as follows:

:CSS:

Jul.05,2022

ide/formatters/" rel=" nofollow noreferrer "> https://eslint.org/docs/user-...


react-error-overlay


solution: install the plug-in error-overlay-webpack-plugin

     https://www.npmjs.com/package/error-overlay-webpack-plugin


Menu