-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
process is not defined when importing Web3 in a SvelteKit page. #4873
Comments
I replied to your message on discord, i'll be closing this issue and hopefully I can help debug this on discord |
@luu-alex Thanks a lot! For posterity: If anyone else stumbles upon this issue, I solved it following this article: https://medium.com/@ftaioli/using-node-js-builtin-modules-with-vite-6194737c2cd2 Basically add that to |
Any less violent solution? |
move to ethers or don't use vite hahaha |
@Garito I found that switching to |
Is this packet not maintained? |
@Garito As you can see from the commit history, it defenitely is maintained, just think |
I got it working with Nuxt 3 + Vite tho |
@skoshx and you don't find your comments about changing libraries a little rude? |
@Garito Defenitely not. As i said, my opinions are strictly subjective, but sharing opinions is important, since others can base their decisions based on other people's opinions. Criticism is important in the developer community, and I don't think people should hold back criticism just because it might seem "rude". Criticism is what fuels improvement. I just wanted to share my positive experience of switching to |
I will be agree with you in another context but... |
@Garito This is what I commented earlier. If you are using |
And as I ask before...
I don't think I'm asking something very extreme, isn't it? A library level solution for this Another issue will be that the maintainers of this packet don't care (the ethers solution will seem much more reasonable then) |
Is there an existing issue for this?
Current Behavior
Importing Web3 in any SvelteKit page with
import Web3 from 'web3';
results in an error "process is not defined". Error stems fromweb3-core-requestmanager
that uses somecallbackify
function from node jsutil
package that usesprocess
.Expected Behavior
It is expected that Web3 works in the browser. Right now because of this bug I am not able to use Web3 at all in the browser.
Steps to Reproduce
Reproduction here: https://github.com/skoshx/web3-sveltekit-repro
Literally just add following in any page:
To demonstrate that this is not a SvelteKit specific issue the following causes same error, even though the following ONLY runs in the browser:
Web3.js Version
1.7.1
Environment
Anything Else?
No response
The text was updated successfully, but these errors were encountered: