Dev builds make __data.json?x-sveltekit-invalidated=01
requests even if +page.server*
does not export a load function
#10022
Labels
bug
Something isn't working
Milestone
Describe the bug
I have some routes with forms where I define form actions in their
+page.server
files. None of these+page.server
files have a load function.I noticed a bit of lag (~300ms) when navigating to those pages in dev builds, which looks to be coming from
__data.json?x-sveltekit-invalidated=01
requests which always return:{"type":"data","nodes":[{"type":"skip"},{"type":"skip"},{"type":"data","data":[null],"uses":{}}]}
. It seems like I can workaround this by removing the individual+page.server
files on each route and moving them to a special, dedicated route that wouldn't be loaded by users, but that feels less than ideal.It looks like this issue was filed before and fixed:
__data.json
request even if+page.*
does not export aload
function #7967__data.json
requests #8636Is it expected for this to still happen in dev builds? It's not a big deal since it's seemingly in dev builds only, but it led to some confusion since we thought we had accidentally introduced latency we didn't expect until we tested outside of dev.
I made a minimal reproduction in Stackblitz with an empty
+page.server
file and see the same issue.Is there a recommended or conventional approach on the placement of such form actions (e.g. in a dedicated route which avoids this also in dev)? Thanks!
Reproduction
https://stackblitz.com/edit/sveltejs-kit-template-default-gegmdq?file=src%2Froutes%2Fpage3%2F%2Bpage.svelte.
Logs
No response
System Info
Severity
annoyance
Additional Information
No response
The text was updated successfully, but these errors were encountered: