3

I tired a lot to run the application as production. I added in application.properties "vaadin.productionMode=true" but so the error "Failed to load content of './frontend/index.html'. It is required to have './frontend/index.html' file when using..." comes up. After I added in main/resources/META_INF/VAADIN/webapp the index.html with the content described in https://vaadin.com/docs/latest/fusion/application/starting#default-bootstrap-template-and-entry-point the error goes away the log files tells that the application has started in production ("Vaadin is running in production mode.") but unfortunately nothing is shown in the webbrowser.

Does anyone have an idea?

Thanks in advance, Thomas

Thomas
  • 131
  • 7
  • Are there errors in your dev-console of your browser? Or in the network tab? – cfrick Aug 09 '21 at 20:06
  • What is the type of project that you have created? flow, fusion or mix of both? did you use start.vaadin.com templates? It is hard to answer question without any mean to reproduce it. – Rathma Aug 10 '21 at 06:20
  • I created a flow project by an template. It is possible to start the application in development mode (webpack is used). By adding the production mode flag I will get the message regarding the missing index.html. I get no error in the development console. There is also no error in the network tab. Is it correct to add the example index.html from the described link above to my project? – Thomas Aug 10 '21 at 20:38

1 Answers1

2

I'm very late to the party, but in addition to setting the vaadin.productionMode property, did you remember to run the Maven goal vaadin:build-frontend as well? (And vaadin:prepare-frontend, but that you probably already had in your development build.)

Documentation about enabling production mode: https://vaadin.com/docs/latest/flow/guide/production

Anna Koskinen
  • 1,362
  • 3
  • 22