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

Change to alwaysHex #61

Merged
merged 1 commit into from Jul 16, 2023
Merged

Change to alwaysHex #61

merged 1 commit into from Jul 16, 2023

Conversation

Crelde
Copy link
Contributor

@Crelde Crelde commented Jul 15, 2023

This seems to fix the issue when using web3js 4.x.x that its not possible to setProvider().

Error before gave this error:

Uncaught (in promise) s: Web3 validator found 1 error[s]:
value "1337" at "/0" must pass "hex" validation
    at c.validate (https://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js:2:634195)
    at t.Web3Validator.validate (https://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js:2:636887)
    at t.hexToNumber (https://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js:2:589899)
    at alwaysNumber (http://127.0.0.1:5174/node_modules/.vite/deps/svelte-web3.js?v=d385d017:17695:60)
    at switch1193Provider (http://127.0.0.1:5174/node_modules/.vite/deps/svelte-web3.js?v=d385d017:17704:18)

You can reproduce in this repo: https://github.com/Crelde/svelte-web3-bug/tree/master

After the fix its possible to setProvider.

fixes #60

@clbrge clbrge merged commit 5cbb7d9 into clbrge:master Jul 16, 2023
@clbrge
Copy link
Owner

clbrge commented Jul 16, 2023

Thanks for the patch... will release a new version

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

Successfully merging this pull request may close these issues.

[Bug]: Cant connect to metamask after latest major upgrade in web3js to v4.x.y
2 participants