devsoap/ds-gradle-vaadin

Production mode does work with gretty config inplaceMode="hard"

Closed this issue · 1 comments

Desktop:

  • OS: iOS
  • JDK version: 8
  • Gradle version: 5.4.1
  • Vaadin Plugin version: 1.2

Describe the bug
Production mode of Vaadin does not work if you have inplaceMode="hard" as a gretty configuration. When you try to open the application in browser, it throws errors for frontend://vaadin-flow-bundle-manifest.json

To Reproduce
Steps to reproduce the behaviour:

  1. Clone https://github.com/devsoap/examples
  2. Cd into beverage-starter-flow-gradle
  3. Add the following config into build.gradle
vaadin {
    // Vaadin version to use
    version = '12.0.0'

    // Enable production mode for production apps
     productionMode = true
}

gretty {
     inplaceMode = "hard"
}
  1. Run the application with ./gradlew appRun
  2. Open http://localhost:8080/beveragebuddy

Expected behavior
Vaadin app runs in production mode

Log

ava.lang.IllegalArgumentException: Failed to find the bundle manifest file 'frontend://vaadin-flow-bundle-manifest.json' in the servlet context for 'ES6' browsers. If you are running a dev-mode servlet container in maven e.g. `jetty:run` change it to `jetty:run-exploded`. If you are not compiling frontend resources, include the 'vaadin-maven-plugin' in your build script. Otherwise, you can skip this error either by disabling production mode, or by setting the servlet parameter 'original.frontend.resources=true'.
	at com.vaadin.flow.server.startup.BundleFilterFactory.readBundleManifest(BundleFilterFactory.java:88)
	at com.vaadin.flow.server.startup.BundleFilterFactory.createBundleFilterForBrowser(BundleFilterFactory.java:78)
	at com.vaadin.flow.server.startup.BundleFilterFactory.createFilters(BundleFilterFactory.java:69)
	at com.vaadin.flow.server.VaadinService.lambda$init$1(VaadinService.java:281)
	at com.vaadin.flow.server.VaadinService.runWithServiceContext(VaadinService.java:2311)

inplaceMode=hard is not supported currently as it is not compatible with loading resources from multiple locations. The plugin needs to generate some files and to support it we would need to generate those files directly in the project structure which is not ideal.

Closing this as a duplicate of #192