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

Helia with Angular #550

Closed
YugasVasyl opened this issue May 28, 2024 · 6 comments
Closed

Helia with Angular #550

YugasVasyl opened this issue May 28, 2024 · 6 comments

Comments

@YugasVasyl
Copy link

I'm having trouble running Helia with Angular.
Whenever I call createHelia();, I get several errors in the console like WebTransportError: Connection lost. and then the browser tab crashes. I've tried different Angular versions and deploying the code to a server, but I still get the same result.
I have tried to use Helai examples, and they work for me.
What I'm doing wrong? Are there any other alternatives to read/write to ipfs?

@paschal533
Copy link

Hello
Which version of Angular and Helia are you using?
Try and Implement more robust error handling around your createHelia() call to catch and manage exceptions that may be causing the browser to crash. Since you’re getting WebTransportError, ensure that your WebTransport or WebSocket configuration in your Angular app is set up correctly. and If you’re using SSR with Angular, it might affect how client-side code interacts with the browser. Make sure Helia is initialized only on the client-side.

If Helia continues to be problematic, consider these alternatives for interacting with IPFS: IPFS HTTP Client and web3.storage.

@SgtPooki
Copy link
Member

SgtPooki commented Aug 8, 2024

it would be nice if we had an example for devs. see ipfs-examples/helia-examples#308

@SgtPooki
Copy link
Member

SgtPooki commented Aug 8, 2024

@YugasVasyl can you share more information about how your browser tab is crashing? Could you share the code you're using so we can try to reproduce?

@YugasVasyl
Copy link
Author

@SgtPooki @paschal533 I no longer work with Helia, I will probably use some 3th party service like Pinata to store files. About error - it looks like it always crashes Chrome when I call createHelia(); and it's unrelated to Angular. Probably because of missing configuration for WebTransport or WebSocket

@SgtPooki
Copy link
Member

SgtPooki commented Aug 8, 2024

@YugasVasyl Ok thank you for the update. FYI: permanent storing of files in the browser isn't a great plan, and you should always be running a backend node somewhere (your own, pinata, lighthouse, web3.storage, etc..) in order to ensure content stays available.

I'll close this for now, but if you have the old code you can share so we can investigate the crash that would be great.

@SgtPooki SgtPooki closed this as completed Aug 8, 2024
@YugasVasyl
Copy link
Author

@SgtPooki to reproduce it - open any Angular (but I believe it's general issue, not only Angular) project, install helia package (my current local version is 4.2.2), import it and run. I just checked it - it still crashes browser tab. I understand I need to setup additional things, but it looks not ok.

import { createHelia } from 'helia'

createHelia();

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

3 participants