Unable to find index.html when vaadin.productionMode=true

We are developing with Vaadin Flow v24.3.11
I have done mvn clean package -Dproduction and I am starting the application with @Profile("prod") from IntelliJ. Inside application-prod.properties I have vaadin.productionMode=true.

I get this error message everytime now and can’t figure out why. I have experienced this some time back but I do not remember what I did different.

“Unable to find index.html. It should be available on the classpath when running in production mode”

I have tried lots of things but nothing seems to work. Anyone know what needs to be done for this to work correctly?

PS! Sorry but I am not able to share the source directly.

Do you have the production profile activated by production system property?
Otherwise, I think it should be -Pproduction, not -D

But the logs should tell you if build-frontend is executed.

BTW, IIRC vaadin.productionMode=true in application.properties has no effect at all.
The production flag is set by the build-frontend process

Of course you are correct. I had a brain fart. I have messed to much with -D parameters for a long time. LOL

Hmm…having it in application.properties seems wrong I agree. However something happens when I do have it there and not. The application actually switches between development and production mode in some form, but I do however think you are correct that it should be related to the build process.