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

gossipsub: Uncaught TypeError when running in the browser #5620

Open
dariusc93 opened this issue Oct 4, 2024 · 0 comments
Open

gossipsub: Uncaught TypeError when running in the browser #5620

dariusc93 opened this issue Oct 4, 2024 · 0 comments

Comments

@dariusc93
Copy link
Member

dariusc93 commented Oct 4, 2024

Summary

When running an application using libp2p-gossipsub targeting wasm32 in the browser, it seems an error Uncaught TypeError: The specifier “env” was a bare specifier, but was not remapped to anything. Relative module specifiers must start with “./”, “../” or “/”. is produced. After inspection, it points to futures-ticker, which still depends on instant. Previously this was not a problem because we used to have the feature enabled up until #5347 was merged.

Keep in mind, this is just by it being included. It does not have to run the code itself.

Expected behavior

For the application to run in the browser

Actual behavior

Gives an error in console

Relevant log output

No response

Possible Solution

  1. Add instant = { version = "0.1.13", features = ["wasm-bindgen"] } to libp2p-gossipsub when targeting wasm32; or
  2. Submit PR to futures-ticker to enable this feature for wasm32 target (or replace it with web-time); or
  3. Replace futures-ticker with in-house code that performs similar or the same behaviour.

Version

0.54.1 and master

Would you like to work on fixing this bug ?

Maybe

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