Hilla not starting Vite - what am I missing?

391 Views Asked by At

I have created a hilla app using this:

npx @vaadin/cli init --hilla --auth hilla-with-auth

Works fine! Now I am trying to add that to an existing spring boot application, but I am having issues with Vite not starting as it should. No exception. No help in the debug output.

I have added:

  • relevant files in the root (package.json, vite.config.ts, etc.)
  • vaadin-featureflags.properties in resources folder
  • hilla dependencies in pom.xml as well as the build plugin
  • hill annotations to my application class (@Theme, @PWA) and made it extends SpringBootServletInitializer implements AppShellConfigurator

But even if everything seems to be initialized correctly, Vite does not start. Can anyone guide me in the right direction?

This is the most relevant output log:

2022-06-07 08:04:54.046 DEBUG 4947 --- [restartedMain] c.v.f.s.f.s.FullDependenciesScanner      : 
     List of npm dependencies found in the project:
      - @hilla/form 1.0.1 dev.hilla.EndpointController
      ....
    2022-06-07 08:04:54.057 DEBUG 4947 --- [restartedMain] c.v.f.s.f.TaskGeneratePackageJson        : writing file /Users/michael/Development/Previsto/previsto-server/target/flow-frontend/package.json.
    2022-06-07 08:05:02.102  INFO 4947 --- [restartedMain] o.a.container.JSR356AsyncSupport         : JSR 356 Mapping path /vaadinServlet
    2022-06-07 08:05:02.176  INFO 4947 --- [restartedMain] c.v.f.s.DefaultDeploymentConfiguration   : 
    Vaadin is running in DEBUG MODE.
    When deploying application for production, remember to disable debug features. See more from https://vaadin.com/docs/
    
    The following EXPERIMENTAL features are enabled:
    - Use Vite for faster front-end builds
    
    
    2022-06-07 08:05:02.207 DEBUG 4947 --- [restartedMain] c.v.f.s.c.PushRequestHandler             : Using pre-initialized Atmosphere for servlet springServlet
    2022-06-07 08:05:02.210 DEBUG 4947 --- [restartedMain] c.v.flow.server.VaadinServletService     : Using 'com.vaadin.flow.server.communication.IndexHtmlRequestHandler' in client mode bootstrapping
    2022-06-07 08:05:02.212 DEBUG 4947 --- [restartedMain] com.vaadin.flow.server.VaadinService     : The application has the following routes: 
    2022-06-07 08:05:02.956  INFO 4947 --- [restartedMain] c.v.flow.server.frontend.FrontendTools   : Project node version 16.10.0 is older than 16.14.0. Using node from /Users/michael/.vaadin.
    2022-06-07 08:05:03.404 DEBUG 4947 --- [http-nio-8080-exec-1] c.v.f.s.s.VaadinDefaultRequestCache      : Saving request to /
    2022-06-07 08:05:03.471 DEBUG 4947 --- [http-nio-8080-exec-2] c.v.b.devserver.AbstractDevServerRunner  : Requesting resource from Vite http://localhost:0/login
    2022-06-07 08:05:03.486 ERROR 4947 --- [http-nio-8080-exec-2] o.a.c.c.C.[.[.[/].[springServlet]        : Servlet.service() for servlet [springServlet] threw exception
    
    java.net.ConnectException: Can't assign requested address (connect failed)
        at ...
0

There are 0 best solutions below