ipfs / js-ipfs

IPFS implementation in JavaScript
https://js.ipfs.tech
Other
7.43k stars 1.25k forks source link

OperationError: The operation failed for an operation-specific reason (anonymous function): Gnome Epiphany & Tauri #4266

Closed AustinFoss closed 1 year ago

AustinFoss commented 1 year ago

Severity:

medium

Description:

Error creating a js-ipfs (ipfs & ipfs-core) node in a Tauri project.

OperationError: The operation failed for an operation-specific reason (anonymous function)

I started by trying to get js-ipfs working with a build of my Nuxt 3 app using Tauri (Rust counterpart of Electron). It produced a non-descriptive error so I tested a plain TS implementation using the template produced with yarn create tauri-app and got a different non-descriptive error, similar to the one mentioned in issue #3878, but much longer, you can find the repo I used here

Prior to this issue I opened one in the Tauri repo here

After someone on their team explained a bit, and pointed me in the direction of #3878, I tried create(options) with all 3 options passed to options.init.algorithm; 'Ed25519', 'RSA', secp256k1'. No luck.

Steps to reproduce the error:

Clone my linked repo, cd into it, and:

yarn && yarn dev

Open link in the Epiphany browser. Or wait a little longer for Tauri, you may need to install Tauri and rust deps, to compile it and run:

yarn && yarn tauri dev

Clicking the "Init IPFS" button tries running the create() function which causes the error.

Do you think this is a problem with Epiphany or with WebKitGTK? The ipfs node is created fine when yarn dev is output in any other desktop browser I've tested except Epiphany(which is what Tauri uses for display). Is there a work around usable through js-ipfs or should I take this to the webkitgtk repo?

I know support for the Epiphany browser is probably not high on anyone's priority list, can't imagine many people use it as a daily driver, but compatibility could be useful for building IPFS desktop/mobile apps with tauri.

welcome[bot] commented 1 year ago

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review. In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment. Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

Finally, remember to use https://discuss.ipfs.io if you just need general support.

AustinFoss commented 1 year ago

Friendly bump , I know it's sunday and I'm not in a rush

Ran another test using the example repo from js-ipfs-examples, using the 'browser-vite' example: https://github.com/ipfs-examples/js-ipfs-examples/tree/master/examples/browser-vite

For the purposes of replication, and if you don't trust my repo, or are suspicious Tauri is adding something unique to the dependencies that's causing the problem, your example repo also results in the same error using Epiphany but works just fine in Brave.

achingbrain commented 1 year ago

js-IPFS is in the process of being deprecated, the replacement is Helia - please see the State of IPFS in JS post for a bit of background and the migration guide for how to port your app over.

I'm not 100% but I think the wonderfully descriptive The operation failed for an operation-specific reason error was something to do with a difference between WebKit and every other rendering engine around key derivation - it was fixed by https://github.com/libp2p/js-libp2p-crypto/pull/313 - can you please upgrade your app to Helia and see if the problem still exists?