Skip to content
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

build broken in next.119: fetch is not defined #1787

Closed
kamholz opened this issue Jun 30, 2021 · 2 comments
Closed

build broken in next.119: fetch is not defined #1787

kamholz opened this issue Jun 30, 2021 · 2 comments

Comments

@kamholz
Copy link

kamholz commented Jun 30, 2021

Describe the bug
If I do npm run build on SvelteKit next.119, and then try to start the app with node build, I get the following error:

file://.../app/build/index.js:2502
  serverFetch: hooks.serverFetch || fetch
                                    ^

ReferenceError: fetch is not defined
    at get_hooks (file://.../app/build/index.js:2502:37)
    at init (file://.../app/build/index.js:2207:12)
    at file://.../app/build/index.js:2554:1
    at ModuleJob.run (node:internal/modules/esm/module_job:175:25)
    at async Loader.import (node:internal/modules/esm/loader:178:24)
    at async Object.loadESM (node:internal/process/esm_loader:68:5)
    at async handleMainPromise (node:internal/modules/run_main:63:12)

I know that everything worked fine in next.117. This seems to be related to the serverFetch patch. I'm not aware of anything unusual in my code that should have caused it to break. In any case, the error suggests the issue is with SvelteKit itself.

Information about your SvelteKit Installation:

  System:
    OS: macOS 11.4
    CPU: (8) arm64 Apple M1
    Memory: 254.17 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 16.4.0 - /opt/homebrew/bin/node
    npm: 7.19.0 - /opt/homebrew/bin/npm
  Browsers:
    Chrome: 91.0.4472.114
    Safari: 14.1.1
  npmPackages:
    @sveltejs/adapter-node: ^1.0.0-next.29 => 1.0.0-next.29 
    @sveltejs/kit: ^1.0.0-next.119 => 1.0.0-next.119 
    svelte: ^3.37.0 => 3.38.2

Severity
Highest. This makes it impossible for me to use SvelteKit on next.119.

@kamholz
Copy link
Author

kamholz commented Jun 30, 2021

I see this is a duplicate, sorry!

@kamholz kamholz closed this as completed Jun 30, 2021
@manuel3108
Copy link
Contributor

For reference: #1784

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants