Skip to content

adapters now require node-fetch to be a dependency of the app #1076

@Rich-Harris

Description

@Rich-Harris

Describe the bug
Unanticipated side-effect of #1066node-fetch isn't available when the app is built on e.g. Netlify:

image

We could make it a peer dependency of the adapters, but that would suck. I think it might be better if adapters took responsibility for bundling the output of svelte-kit build (with eg. esbuild — this functionality could also be exposed via the adapter utils). Then, if we exposed something like @sveltejs/kit/install-fetch for the relevant adapters to use (rather than expecting them to use the correct version of node-fetch and correctly assign the relevant bits to globalThis), it wouldn't mean needing @sveltejs/kit to be a production dependency.

Severity
Completely blocks use of the affected adapters, AFAICT

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions