Skip to content

Commit

Permalink
undo #await dance
Browse files Browse the repository at this point in the history
  • Loading branch information
dummdidumm authored Jan 24, 2023
1 parent 11e6d5d commit f0cd825
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/kit/src/exports/vite/dev/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ export async function dev(vite, vite_config, svelte_config) {
}

const fetch = globalThis.fetch;
globalThis.fetch = async (info, init) => {
globalThis.fetch = (info, init) => {
if (typeof info === 'string' && !/^\w+:\/\//.test(info)) {
await Promise.resolve(); // allows people to use malformed fetch urls in `{#await ..}` (native fetch error is swallowed by those)
throw new Error(
`Cannot use relative URL (${info}) with global fetch on the server. If this is called inside a \`load\` function, use \`event.fetch\` instead: https://kit.svelte.dev/docs/web-standards#fetch-apis`
);
Expand Down

0 comments on commit f0cd825

Please sign in to comment.