lquixada / cross-fetch

Universal WHATWG Fetch API for Node, Browsers and React Native.
MIT License
1.67k stars 104 forks source link

Incompatible with Vite / SvelteKit #109

Closed autr closed 3 years ago

autr commented 3 years ago

SvelteKit renders both SSR and client-side - I have a simple HTML module that I want to include, that calls fetch - currently the polyfill causes the client-side to try to require, and other permutations (bare import etc) cause fetch-is-not-found errors server-side. I see some mentions in the issues of creating a webpack pipeline specifically for each use case, which seems confusing since I assumed the point of this module is to be a polyfill server-side?

Thanks