Description
Describe the bug
When using links within the SvelteKit app, the URL gets updated immediately, even though the underlying page is still loading. In this simple demonstration the second-page loads for 1s, but the URL is updated a immediately:
This is unconventional and results in asynchrony between the URL and the page content.
For contrast, here is what happens when clicking on the second link with rel="external", which triggers normal browser behavior:
Here you can see that both the URL and the page change at the same time. The page represents the URL at every moment. This behavior and universal across browsers.
SvelteKit mimicks browser behavior with History API. To do it correctly, the URL needs to be changed after the page is loaded.
Reproduction
Logs
No response
System Info
-
Severity
annoyance
Additional Information
No response