-
Notifications
You must be signed in to change notification settings - Fork 1.2k
error: Could not resolve "electron" when using in a web app #4011
error: Could not resolve "electron" when using in a web app #4011
Comments
Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
Finally, remember to use https://discuss.ipfs.io if you just need general support. |
We can second this issue. None of the previous versions work either btw. I don't think this lib is truly ESM currently? |
I think I tracked down the core of the problem. The That package relies on Apparently, that resolves to Temporarily hard-coding that to I think |
It seems like a bit of a rabbit hole... I also played around with the files as you did forcing it to return false as a test from the electron detection, but there there we just more of similar issue from other non esm modules being used. For now I am just going to use a project via |
As a workaround you can add this to your vite config: optimizeDeps: {
exclude: ['ipfs-http-client', 'electron-fetch']
} |
added that and the server starts, but now:
|
|
i added this but now m getting Uncaught SyntaxError: Unexpected string this error how can i fix this??? |
@abir-sharma if you're using Vite, this may be the reason: vitejs/vite#3229 |
I'm building a react library that uses this library. I get the error that electron is not found and is needed by the I'm using rollup to bundle as |
Same here in SvelteKit / Vite, excluding these from optimize deps creates other errors for me, unfortunately a 500 one with not much traceback |
Same issue with SvelteKit / Vite, using "ipfs-http-client": "^56.0.2" |
Does anyone know of a setup that doesn't run into this? The only thing that works for me is vanilla js. |
I am using Vite + Svelte and also having the issue with |
A workaround is to mark
Update: Sorry, not working, getting a 500 after this. |
I had a similar issue with This
|
js-ipfs is being deprecated in favor of Helia. You can follow the migration plan here #4336 and read the migration guide. This issue has been resolved in Helia! if this does not address your concern please let us know by reopening this issue before 2023-06-05! |
Hi I get the following in a vite/vue app when i import ipfs
It only happens when I import ipfs but I am confused why electron would be involved at all in this situation.
I have seen people use ipfs fine in react (web) apps
The text was updated successfully, but these errors were encountered: