Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webpack error in browser should include the useful information #7833

Closed
Artur- opened this issue Mar 18, 2020 · 0 comments
Closed

Webpack error in browser should include the useful information #7833

Artur- opened this issue Mar 18, 2020 · 0 comments

Comments

@Artur-
Copy link
Member

Artur- commented Mar 18, 2020

If you are missing a files from node_modules, which seems to happen way more often than you would like you get a quite needlessly filtered error output in the browser that does not say much about the problem.

If you do e.g.

npx @vaadin/cli init err
cd err
mvn

ctrl-c when server is started

rm node_modules/@vaadin/vaadin-ordered-layout/theme/lumo/vaadin-horizontal-layout-styles.js
mvn

What you will see in the browser when opening the app is

Webpack Error
Webpack build failed with errors:
ERROR in ../node_modules/@vaadin/vaadin-ordered-layout/theme/lumo/vaadin-horizontal-layout.js
ERROR in ../node_modules/@vaadin/vaadin-ordered-layout/theme/lumo/vaadin-horizontal-layout.js

Problems here are:

  1. There is no ERROR in the given file, the problem is that it is missing
  2. Based on the error message, there is nothing I can do to try to fix it except for mvn clean, which does not help
  3. The more useful information is output to the server console, but hidden way up in the log so you won't necessarily notice the error by looking at the log in e.g. Eclipse
Running webpack to compile frontend resources. This may take a moment, please stand by...
ERROR in ../node_modules/@vaadin/vaadin-ordered-layout/theme/lumo/vaadin-horizontal-layout.js
Module not found: Error: Can't resolve './vaadin-horizontal-layout-styles.js' in '/.../node_modules/@vaadin/vaadin-ordered-layout/theme/lumo'
 @ ../node_modules/@vaadin/vaadin-ordered-layout/theme/lumo/vaadin-horizontal-layout.js 1:0-46
 @ ../target/frontend/generated-flow-imports.js

ERROR in ../node_modules/@vaadin/vaadin-ordered-layout/theme/lumo/vaadin-horizontal-layout.js
Module not found: Error: Can't resolve './vaadin-horizontal-layout-styles.js' in '.../node_modules/@vaadin/vaadin-ordered-layout/theme/lumo'
 @ ../node_modules/@vaadin/vaadin-ordered-layout/theme/lumo/vaadin-horizontal-layout.js 1:0-46
 @ ../target/frontend/generated-flow-imports.js
ℹ 「wdm」: Failed to compile.

While this message is not super useful either it still makes me realize that the problem is a missing file in node_modules so the problem is not in my project but in a dependency or the installation of the dependencies.

The relevant info should definitely not be removed. I think it used to be there in earlier versions. Tested with 14.1.20

@caalador caalador moved this from Needs triage to New P2 in OLD Vaadin Flow bugs & maintenance (Vaadin 10+) Mar 25, 2020
@pleku pleku moved this from New P2 to Internal Backlog / Technical Debt in OLD Vaadin Flow bugs & maintenance (Vaadin 10+) Mar 25, 2020
@pleku pleku moved this from Internal Backlog / Technical Debt to WIP in OLD Vaadin Flow bugs & maintenance (Vaadin 10+) Mar 25, 2020
@caalador caalador self-assigned this Mar 25, 2020
@caalador caalador moved this from Ready To Go to In progress in OLD Vaadin Flow ongoing work (Vaadin 10+) Mar 25, 2020
caalador added a commit that referenced this issue Mar 25, 2020
Collect lines from error until
a empty line or i (information) line marker.

Fixes #7833
denis-anisimov pushed a commit that referenced this issue Mar 27, 2020
Collect lines from error until
a empty line or i (information) line marker.

Fixes #7833
caalador added a commit that referenced this issue Mar 27, 2020
Collect lines from error until
a empty line or i (information) line marker.

Fixes #7833
OLD Vaadin Flow ongoing work (Vaadin 10+) automation moved this from In progress to Done - pending release Mar 27, 2020
OLD Vaadin Flow bugs & maintenance (Vaadin 10+) automation moved this from WIP to Closed - pending release Mar 27, 2020
caalador added a commit that referenced this issue Mar 27, 2020
Collect lines from error until
a empty line or i (information) line marker.

Fixes #7833
@denis-anisimov denis-anisimov added this to the 2.1.7 milestone Apr 1, 2020
@denis-anisimov denis-anisimov moved this from Done - pending release to Released in OLD Vaadin Flow ongoing work (Vaadin 10+) Apr 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants