Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite project reloading #2573

Open
victj99 opened this issue Jun 24, 2024 · 5 comments
Open

Infinite project reloading #2573

victj99 opened this issue Jun 24, 2024 · 5 comments
Labels
bug Something isn't working hilla Issues related to Hilla investigation

Comments

@victj99
Copy link

victj99 commented Jun 24, 2024

Describe the bug

When I create a project with npm vaadin init and run it, it keeps reloading without stopping.

2024-06-24_10-47-42.mp4

Expected-behavior

No response

Reproduction

Create a new project with npm vaadin init.

Run the project

System Info

Macos Sonoma 14.5
Java 21

@victj99 victj99 added bug Something isn't working hilla Issues related to Hilla labels Jun 24, 2024
@marcushellberg
Copy link
Member

Seems like it might be the same as vaadin/flow#19280

@trapperkeeper
Copy link

I am experiencing the same issue. If I download the Hello World project FLOW/Java, it starts fine. But if I use the app starter UI (https://start.vaadin.com/app/p) and create a React (Hilla) app, I get an infinite restart loop.

I see this in the output:
"Restarting due to 2 class path changes (0 additions, 0 deletions, 2 modifications)"

I feel like the React build is creating files that the Spring devtools is seeing as new. Perhaps there is a way to exclude those files? I tried to identify and ignore a couple of files that I thought might be the culprits, but no luck so far.

@trapperkeeper
Copy link

I should note that adding the following to application.properties prevents the infinite restarts. However, it at least partly disabled hot reloading as well:

spring.devtools.restart.enabled = false

@codercodingthecode
Copy link

I found a way to stop the application from rebooting.
Until a permanent solution comes from the Vaadin team or the IDE maintainers, it seems like the hot-reload scripts are targeting files in src/main/frontend/generated/.
This causes the application to keep rebooting/reloading infinitely.

For me, the solution was to add an exclude watch for that directory.
Updates to the backend and frontend hot reload now work as expected.

Apply this in your VSCode/Cursor settings, add the following to your settings.json:

{
  "files.watcherExclude": {
    "**/src/main/frontend/generated/**": true
  },
}

@trapperkeeper
Copy link

trapperkeeper commented Jul 19, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hilla Issues related to Hilla investigation
Projects
None yet
Development

No branches or pull requests

5 participants