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

ReplicaDriverWeb not accessible from all environments #310

Closed
keks opened this issue Feb 10, 2023 · 4 comments
Closed

ReplicaDriverWeb not accessible from all environments #310

keks opened this issue Feb 10, 2023 · 4 comments

Comments

@keks
Copy link

keks commented Feb 10, 2023

What's the problem you want solved?

I noticed that ReplicaDriverWeb is not accessible from my setup. It also doesn't show up in the API docs.

I use npm with webpack. It's very small, no fancy build scripts. I import earthstar using

import * as Earthstar from "earthstar";

and that works and most functionality is there, but ReplicaDriverWeb isn't.

When using it from a simple js file with type=module and the cdn import it worked fine. No idea what the cause is, I don't know JS/TS tooling very well.

Is there a solution you'd like to recommend?

Sorry, no.

@keks
Copy link
Author

keks commented Feb 10, 2023

Oh and I depend on version ^10.0.1

@sgwilym
Copy link
Contributor

sgwilym commented Feb 11, 2023

Hi @keks! In the NPM distribution some exports have been moved to earthstar/browser and earthstar/node. I realise the docs don't mention this, so apologies!

import * as Earthstar from "earthstar";
import { ReplicaDriverWeb } from "earthstar/browser"; 

Let me know if that helps.

@sgwilym
Copy link
Contributor

sgwilym commented Feb 11, 2023

You're right about ReplicaDriverWeb being missing from the API docs. It's because those docs are generated from the Deno entrypoint, which doesn't export it. Seems I need to add links for the browser and Node entrypoints to the website too.

@sgwilym
Copy link
Contributor

sgwilym commented Feb 14, 2023

As the README has been updated and the website now lists APIs for all environments on the website, I'd like to think it'd be harder for some to get into the same situation as you did.

@sgwilym sgwilym closed this as completed Feb 14, 2023
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