-
Notifications
You must be signed in to change notification settings - Fork 41.5k
Description
To reproduce the problem
- go to https://vaadin.com/start
- click "download" to get the Spring Boot starter
- unzip and run
mvn
- When app has started, open http://localhost:8080 to verify that the main view with a button is shown
- While the app is running, do
mv target/classes/com/packagename/myapp/MainView.class . ; sleep 2 ; mv MainView.class target/classes/com/packagename/myapp/MainView.class
- Refresh the browser and you will see
Could not navigate to ''
Reason: Couldn't find route for ''
instead of the expected view
Note that sleep 2
is dependent on how fast your machine is. On my recent Macbook Pro, 2
is a suitable time to sleep.
If the delay is too short, then devtools will wait for both the removal of the old class and addition of the new class before restarting and the view will be available. If the delay is too long, then devtools will first restart once after the removal and then notice the new class later and restart again. Thus the view will also be available in the end although missing on one reload in between.
When the time is just right, devtools will fail to notice that the class has been added and will just restart the application without the class
Adjusting
spring.devtools.restart.poll-interval
and
spring.devtools.restart.quiet-period
to some degree helps this but is no generic solution as working and broken values are dependent on the speed and load of the development machine.
Now this is not just academic but at least IntelliJ IDEA apparently works like this: first the class is removed and then a new one is created.