Skip to content

Commit

Permalink
Merge branch '4.x' into 4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonandjay authored Dec 10, 2024
2 parents 8b2f924 + fa5ce5b commit 11d1416
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2864,3 +2864,9 @@ If there are any bugs, improvements, optimizations or any new feature proposal f
- Updated Typescript version 4 -> 5 (#7272)

## [Unreleased]

### Added

#### web3-validator

- Add web3-validator dist path for react-native builds (#7416)
24 changes: 24 additions & 0 deletions docs/docs/guides/18_resources_and_troubleshooting/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,30 @@ Additional Info:

[Facebook/React-native Issue #28492](https://github.com/facebook/react-native/issues/28492#issuecomment-824698934)

### TypeError: Cannot read property 'prototype' of undefined, js engine: hermes

This error occurs when trying to use Web3.js with React Native. To solve this error, use [the `react-native-quick-crypto` package](https://www.npmjs.com/package/react-native-quick-crypto).

**Resolution Steps:**

1. Install `react-native-quick-crypto` as a dependency:

```bash
yarn add react-native-quick-crypto
```

2. Set up `react-native-quick-crypto`:

```bash
cd ios && pod install
```

3. Ensure that Web3.js is imported using the default import, as using a named import does not work:

```bash
import Web3 from 'web3';
```

## Resources

### [Web3.js v4 course](https://www.youtube.com/watch?v=3ZO_t-Kyr1g&list=PLPn3rQCo3XrP4LbQcOyyHQR8McV7w3HZT)
Expand Down
4 changes: 4 additions & 0 deletions packages/web3-validator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,7 @@ Documentation:
- `browser` entry point that was pointing to a non-existing bundle file was removed from `package.json` (#7015)

## [Unreleased]

### Added

- Add web3-validator dist path for react-native builds (#7416)
1 change: 1 addition & 0 deletions packages/web3-validator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"require": "./lib/commonjs/index.js"
}
},
"./dist/web3-validator.min.js": "./dist/web3-validator.min.js",
"repository": "https://github.com/ChainSafe/web3.js",
"author": "ChainSafe Systems",
"license": "LGPL-3.0",
Expand Down

0 comments on commit 11d1416

Please sign in to comment.