sveltejs / sveltejs/kit

Suppress the fetch warning automatically whenever SSR is disabled / hash routing is enabled

Open
#13,689 6 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs-decision
Dominant language
JavaScript
Stars
20.8k
Forks
2.3k
Avg merge
1d 16h
Merged PRs (30d)
156

Description

Describe the problem

It's a little frustrating whenever my console is flooded with messages similar to this when I am developing a hash routing application.

⚡️  [warn] - Loading http://localhost:8090/api/collections/users/auth-refresh 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

My understanding from the docs (please feel free to correct me) is that sveltekit's fetch would have no purpose or advantage whatsoever whenever hash routing is enabled.

(additionally - I am using a third party library so even if there was a purpose to replace the fetch, there would be no way for me to.)

Describe the proposed solution

A check before the warning to determine if it's even recommended.

Potentially related to https://github.com/sveltejs/kit/issues/13217?

Alternatives considered

It's extremely insignificant and obviously not a priority. I'd submit a PR myself but figured it'd be good practice to write the issue first in case I am missing something.

Using fetch anyway would be my preferred option but not possible in all cases (e.g. third party libraries)

Importance

nice to have

Additional Information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the warning text about requests made with window.fetch and compare it with the SSR-disabled and hash-routing settings described in the issue and linked load documentation. Confirm the warning is suppressed in those configurations while the existing fetch behavior remains unchanged, and add or update coverage if the relevant test entry point is found.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.