-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReferenceError: fetch is not defined #1784
Comments
This |
This file contain |
ok, reproduced and I know how to fix it, one moment |
There is a work around while the hotfix above has not been committed yet. src/hooks.js: /** @type {import('@sveltejs/kit').ServerFetch} */
export async function serverFetch(request) {
/*
if (request.url.startsWith('https://api.yourapp.com/')) {
// clone the original request, but change the URL
request = new Request(
request.url.replace('https://api.yourapp.com/', 'http://localhost:9999/'),
request
);
}
*/
return fetch(request);
} |
* fix: Externalize app initialization to adapters Fixes #1784 * fix(lint) * chore: spacing changes * chore: Add todo in adapter-begin
This change cause fetch is not defined error with sveltekit + node-adapter.
Describe the bug
Build svelte-kit project with node-adapter,
execute with node v14.16.0, it fails with error "ReferenceError: fetch is not defined"
Logs
To Reproduce
change svelte.config.js on
The text was updated successfully, but these errors were encountered: