Skip to content

awei82/svelte-async-bug-poc

Repository files navigation

POC of Svelte async compiler option bug

Summary

The async experimental compiler option causes a client-side navigation failure on a weird edge case: When a +layout.svelte exists on a route, client-side navigation to another route causes futher client-side navigation to fail.

Setup:

  • repo generated with sv create
  • svelte.config.js experimental async flag is set to true
  • +layout.svelte is present in a route (/start is used in this example)

To reproduce:

  • start the dev server
  • open browser
  • Follow the links:
    • /start -> /dashboard -> /dashboard/test
      • URL correctly updates to /dashboard/test, but page does not load

I've also included a working example: /start-no-layout -> /dashboard -> /dashboard/test

  • In this case, the navigation works because there is no +layout.svelte in the /start-no-layout route.

Additional observations

If data-sveltekit-preload-data="hover" is removed from app.html, the navigation works again.

About

POC of Svelte async compiler option bug

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published