2021-01-01 13:00:48.941 INFO 8 — [ main]
c.v.f.s.VaadinServletContextInitializer : Search for subclasses and classes with annotations took 1 seconds
2021-01-01 13:00:48.948 ERROR 8 — [ main]
o.a.c.c.C.[Tomcat]
.[localhost]
.
[/] : Exception sending context initialized event to listener instance of class [com.vaadin.f
low.spring.VaadinServletContextInitializer$DevModeServletContextListener]
java.lang.IllegalStateException: Failed to determine project directory for dev mode. Directory ‘/’ does not look like a Maven or Gradle project. Ensure that you have run the prepare-fr
ontend Maven goal, which generates ‘flow-build-info.json’, prior to deploying your application
at com.vaadin.flow.server.startup.DevModeInitializer.getBaseDirectoryFallback(DevModeInitializer.java:399) ~[flow-server-2.4.3.jar!/:2.4.3]
at com.vaadin.flow.server.startup.DevModeInitializer.initDevModeHandler(DevModeInitializer.java:255) ~[flow-server-2.4.3.jar!/:2.4.3]
at com.vaadin.flow.spring.VaadinServletContextInitializer$DevModeServletContextListener.contextInitialized(VaadinServletContextInitializer.java:369) ~[vaadin-spring-12.3.2.jar!
Thank you Mr Lund. It was in fact a problem with prepare-frontend and production mode because I didn’t set it up in my pom.xml . I got another problem though. My docker image is 750MB, which is crazy because my app is not that big; the only big folder I have is node_modules. Therefore I can not deploy on GCP because its limited at 250MB I think. Maybe I didn’t build it right.
I was actually just testing how much time it will take me to deploy and I will probably have to read more documentation because I encountered a lot of 500 http errors.
You do not need that folder in runtime, this folder is used only when application is build. The vaadin maven plugin commands npm to download web component libraries etc. there. The prepare_frontend and build_frontend tasks are related. Those will compose optimized frontend bundle containing only those components used by the application and minify it.