-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Open
Open
Copy link
Labels
help wantedPRs welcomed. The implementation details are unlikely to cause debatePRs welcomed. The implementation details are unlikely to cause debateready to implementplease submit PRs for these issues!please submit PRs for these issues!
Description
Describe the bug
I'm using a remote function to check if an album exists based on the provided album ID in the route param /album/[id]. If the album doesn't exist for the given ID, I'd like to throw a 404 or simply redirect the user back to the album list page. However, doing so falsely warns me to use the load function provided fetch instead of window.fetch
Reproduction
- Open your browser console
- Navigate from the home page to the album page from the nav bar.
- Observe the warning about using
window.fetch
Logs
Loading /_app/remote/go4pcy/getAlbum?payload=WyI4SkI3cFNSc3JEbTFLcTZ3b0JhcEIiXQ using `window.fetch`. For best results, use the `fetch` that is passed to your `load` function: https://svelte.dev/docs/kit/load#making-fetch-requests
warn @ client.js?v=ba405339:3209
window.fetch @ fetcher.js?v=ba405339:55
remote_request @ shared.svelte.js?v=ba405339:10
(anonymous) @ query.svelte.js?v=ba405339:29
#run @ query.svelte.js?v=ba405339:233
Query @ query.svelte.js?v=ba405339:204
(anonymous) @ query.svelte.js?v=ba405339:23
(anonymous) @ shared.svelte.js?v=ba405339:77
load @ +page.ts:5
load_node @ client.js?v=ba405339:873
await in load_node
(anonymous) @ client.js?v=ba405339:1122
load_route @ client.js?v=ba405339:1093
_preload_data @ client.js?v=ba405339:524
preload @ client.js?v=ba405339:1928
await in preload
(anonymous) @ client.js?v=ba405339:1873
setTimeout
(anonymous) @ client.js?v=ba405339:1872Understand this warningSystem Info
System:
OS: macOS 26.2
CPU: (8) arm64 Apple M1 Pro
Memory: 70.19 MB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 24.13.0 - /Users/teeming/Library/pnpm/node
Yarn: 3.2.3 - /Users/teeming/Library/pnpm/yarn
npm: 11.6.2 - /Users/teeming/Library/pnpm/npm
pnpm: 10.28.2 - /Users/teeming/Library/pnpm/pnpm
bun: 1.3.6 - /opt/homebrew/bin/bun
Browsers:
Chrome: 144.0.7559.133
Chrome Canary: 135.0.7048.0
Firefox: 144.0
Firefox Developer Edition: 130.0
Safari: 26.2
Safari Technology Preview: 26.0
npmPackages:
@sveltejs/adapter-cloudflare: ^7.2.6 => 7.2.6
@sveltejs/kit: ^2.50.1 => 2.50.2
@sveltejs/vite-plugin-svelte: ^6.2.4 => 6.2.4
svelte: ^5.48.2 => 5.49.2
vite: ^7.3.1 => 7.3.1Severity
annoyance
Additional Information
In retrospect, this is probably the wrong way to do this. Maybe I should simply do the redirect in the component itself? Or separate the data fetching logic from the remote function and reuse that directly in a server load function? I thought doing the redirect in the load function would be more performant because then it doesn't need download and render the component code just to redirect
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
help wantedPRs welcomed. The implementation details are unlikely to cause debatePRs welcomed. The implementation details are unlikely to cause debateready to implementplease submit PRs for these issues!please submit PRs for these issues!