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

V 14.1.x: Fails to run "Starter Project" on Tomcat 9 in dev mode, dev-webpack ERROR (Frontend compilation failed) #7137

Closed
darmro opened this issue Dec 11, 2019 · 7 comments

Comments

@darmro
Copy link

darmro commented Dec 11, 2019

Environment:
Eclipse 2019-09, Tomcat 9 (configured as server in Eclipse), JDK8
I took "Starter Project" (with spring) and changed pom to be war application.

When in pom Vaadin is set to 14.1.2 then the starter app does not start in Tomcat because of errors from dev-webpack:

dev-webpack: ERROR in ../node_modules/@vaadin/flow-frontend/comboBoxConnector-es6.js
dev-webpack: Module build failed (from ../node_modules/babel-loader/lib/index.js):
dev-webpack: Error: ENOENT: no such file or directory, open 'D:\JAVA-2\workspace\my-starter-project\node_modules\@vaadin\flow-frontend\comboBoxConnector-es6.js'
dev-webpack: @ ../target/frontend/generated-flow-imports.js 6:0-56

I've tried to clean the project (I've removed node_modules, package.json, package-lock.json, and even webpack.config.js, webpack.generated.js) than did: mvn clean package, npm ddp, npm install. Then I add the app to Tomcat sever and start the server. It didn't help, there was the same webpack errors and Frontend compilation failed.

When in the same app I set in pom Vaadin ver. 14.0.15 (and clean the project at first) I could run this starter app in dev mode adding it to Tomcat server- everything is fine (no dev-webpack errors during tomcat starting), app starts normaly and works fine!

When I return to V 14.1.2, clean the project (as mentioned before) the webpack errors are again. I've even removed everything from the project, leaving only src, frontend and pom, import it to eclipse- it didn't help.

So it's only the problem with V 14.1.x (on 14.1.0 and 14.1.1 too).
What I'm doing wrong?

pom_and_logs.zip

@juhopiirainen
Copy link

Hi! Is there a production mode available? Can you build the app using mvn install -Pproduction and test if it runs after?

@juhopiirainen juhopiirainen transferred this issue from vaadin/platform Dec 11, 2019
@juhopiirainen
Copy link

I'll move this to the Flow team.

@darmro
Copy link
Author

darmro commented Dec 11, 2019

Hi! I checked this in production mode (mvn clean package -Pproduction, deploy war on Tomcat) and everything was fine (aplication runs and works ok). Probably because dev-webpack is not used ;)
But when I returned to dev mode the problem is still there. No matter if I generate war (mvn clean package) and deploy it on Tomcat or add project in eclipse to Tomcat server.

Please notice (in my 14.1.2.log) that this is executed twice:
com.vaadin.flow.server.startup.DevModeInitializer - Starting dev-mode updaters
so frontend is compiled twice. For the first time frontend is compiled successfully but at the end dev-updater and dev-webpack are executed second time and frontend compilation fails.

@caalador
Copy link
Contributor

A part of it seems like it is about vaadin/spring#525 as the second execution (also does happen with 14.0.15) gets a different set of packages where the inital contains vaadin-custom-field and the latter doesn't. Bringing in the change to spring 12.1 also.

But at least locally the execution of a spring-boot war using 14.1.2 on tomcat 9.0.24 works even if it does do extra work at the moment.

@darmro
Copy link
Author

darmro commented Dec 20, 2019

Hi, I'd like to point out, that i've moved my code to v 14.1.3 and bump up core-js to @3 (such warning was at the beginnig) and now the problem is gone, ie. there are no dev-webpack errors in dev mode :)

@Switcher05
Copy link

After many hours of frustration, I was able to find an answer I believe will help. Basically making a fat jar does not have access to the file path.
https://vaadin.com/forum/thread/17871763/17944324
Tldr; use production mode

@denis-anisimov
Copy link
Contributor

Looks like the original issue is not reproducible with 14.1.3 anymore and another topic is running dev mode on the server which is not able to run dev mode.

So I'm closing the ticket.

OLD Vaadin Flow bugs & maintenance (Vaadin 10+) automation moved this from P2 - Medium Priority to Closed - pending release Mar 31, 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

5 participants