K. Taylor
K. Taylor

Reputation: 521

Vaadin 24.4 Production Mode Build Not Working - flow-build-info.json

The production mode build in 24.4 does not seem to work correctly. The problem seems to be caused by the flow-build-info.json file not being built correctly. We are deploying to a stand-alone Tomcat 10. The WAR deploys but will not start. On start Vaadin complains about the tomcat bin dir "not being a Maven or Gradle project" and says to run the prepare-frontend Maven goal. Well, we are using gradle 8.8 and we have run the vaadinPrepareFrontend many times, before and after vaadinBuildFrontend. Looking at Vaadin's production mode troubleshooting doc, it looks like our flow-build-info.json is completely different.

Here is what our file looks like:

{
  "productionMode": true,
  "eagerServerLoad": false,
  "react.enable": true
}

This is nothing like Vaadin's docs. The docs say that prepare-frontend cretes the file but we don't see that happening. It gets created by the build-frontend task.

The source project was created from a Vaadin starter with Spring and we are building and deploying the WAR to tomcat.

Any idea what might be wrong?

UPDATE: I finally got it working. And its not the flow JSON file. The docs must be out of date. The problem seems to be that because the app was from a starter with Spring Boot in it, you need to set production mode in the application.properties in addition to the build scripts and properties. One thing I would suggest is that Vaadin go through a real deployment and document all the steps. There are missing steps in the docs. And if you are deploying your Vaadin app as a website, and we are, you need extra steps to deploy the app to the root context, as websites usually deploy to '/' and don't use a servlet context. And lastly, the default vaadin dependency includes all Vaadin jars including dev mode jars which you don't want in production. The dev mode jars should not be included by default and have a different dependency for dev mode jars. That simplifies things a lot.

Upvotes: 0

Views: 176

Answers (0)

Related Questions