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

Resolve HTTP not working for both Browser and Node in NPM package. #16

Open
sgwilym opened this issue Mar 28, 2022 · 0 comments
Open

Resolve HTTP not working for both Browser and Node in NPM package. #16

sgwilym opened this issue Mar 28, 2022 · 0 comments

Comments

@sgwilym
Copy link
Contributor

sgwilym commented Mar 28, 2022

What's the problem you want solved?

When the NPM package is bundled, fetch is shimmed using node-fetch. This shim does not work in the browser, which means that users of the NPM versions of earthstar packages cannot sync via HTTP.

Is there a solution you'd like to recommend?

I need to find some solution for either:

  • Shimming with an 'isomorphic' version of fetch which works in both Node and the Browser. I'd probably need to make this myself as there are no packages right now which satisfy dnt's ESM and typings requirements.
  • Possibly splitting build process up so that there is both a Node and Browser version of earthstar-streaming-rpc, further complicating things.
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

1 participant