-
Notifications
You must be signed in to change notification settings - Fork 104
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
Unhandled errors when using Helia in browser #151
Comments
Thanks for submitting this issue @eyalron33, I was able to reproduce this error using https://github.com/ipfs-examples/helia-examples/tree/main/examples/helia-script-tag this error is coming from the underlying libp2p transport, your network seems to be blocking catching these errors is not trivial in the default setup, maybe you want to construct your own libp2p instance which can handle these errors (I've not tried this). @achingbrain I think we can have better error handling around such scenarios or provide an interface to handle these. |
These sorts of errors are logged by the browser and they're not catchable 😭 That said the bootstrap nodes had their config messed up last week and were rejecting connections so I think that may be the root cause here? |
It still persists today. I think that maybe what @whizzzkid proposed, that my network blocks I'll try to play later with the libp2p configuration and see if I can improve it. If yes I'll report here. Anyway, it doesn't do any harm, it's just my OCD of trying to handle all error messages in the console :-) |
I getting the same errors, when trying to run helia vite example. I'm not sure if the errors are as harmless as @eyalron33 says. While the example app seems to be working, I expected that content added through this app would be discoverable by other ipfs nodes. But I'm not able to retrieve it through my local kubo node. Is it a bug, which might be related to the errors above or am I misunderstanding what the example app should be doing? |
This is still true and not something we can control. We have to attempt to dial peers to know if we can connect to them. If we don't attempt the dials, we can't connect to peers. Not all attempts are expected to be successful. The failed attempts will show as errors in the console. I just posted an example of fetching content from a helia node to https://discuss.ipfs.tech/t/how-to-retrieve-content-uploaded-via-helia-using-the-ipfs-gateway/16582/6?u=sgtpooki that you can check out to see that things do work. You can use the helia-connectivity-demo to see the status of a browser Helia node. If you're not seeing connected peers, then no networking activities will work. If you are seeing connected peers, you will still see these errors in the browser because we cannot control them. If you want to hide these errors because they're detracting from your users experience in your app, then you may want to run helia in a web-worker/service-worker which should hide the errors from the main console. I'm going to close this issue because these errors are a normal part of failed attempts to connect to a large variety of nodes throughout the IPFS p2p network. |
I'm getting console errors when using Helia in the browser. The errors come from bad calls, either to
cid.contact
or to sockets of bootstrap nodes. I get those errors even when trying the helia-script-tag or helia-vite examples.I don't manage to catch and handle these errors. I tried surrounding the
createHelia
withtry..catch
, but it didn't catch those errors.I get errors both when running in Firefox and Brave, though the errors are slightly different in each. I attached screenshots of that below. The errors are generated when using the apps in
http://localhost:<somePort>/
.Questions:
Screenshots:
Firefox console errors:
Brave console errors:
The text was updated successfully, but these errors were encountered: