devsoap / ds-gradle-vaadin

Gradle plugin for building Vaadin Flow 10/11/12/13/14/15 apps
https://devsoap.com/gradle-vaadin-flow-plugin
Other
36 stars 13 forks source link

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

Closed Shridhad closed 4 years ago

Shridhad commented 4 years ago

Desktop:

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" }

5. Run the application with `./gradlew appRun`
6. 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)

johndevs commented 4 years ago

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