-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Describe the bug
A SvelteKit application makes a request to __data/json even when no actual load function gets exported inside +page.server.js.
I would expect that no unnecessary request gets made as it should be clear to SvelteKit that it can't fetch any data from that endpoint.
Someone could argue if an empty +page.server.ts file makes sense at all.
Maybe SvelteKit should throw an error if it sees that a +page.server.ts file does not export anything that is useful to SvelteKit.
I could imagine there will be some users that create a load function, but forget to export it. In this case an error message would be really helpful before they have to figure out what they did wrong.
Of course this would make sense for all other +*.ts files
Reproduction
- start the application
- hover over the link
- check the logs, a request to
/test/__data.jsonwas made, even if+page,server,tsdoes not export aloadfunction
Logs
No response
System Info
StackBlitzSeverity
annoyance
Additional Information
No response