Reputation: 10378
With React Native 0.70.x app, upgrading from ethers v5.7 to v6.7 causes the error below:
error: node_modules/ethers/lib.commonjs/abi/abi-coder.js: /Users/macair/Documents/code/js/xyz_app6/node_modules/ethers/lib.commonjs/abi/abi-coder.js: Class private methods are not enabled. Please add `@babel/plugin-proposal-private-methods` to your configuration.
111 | */
112 | class AbiCoder {
> 113 | #getCoder(param) {
| ^
114 | if (param.isArray()) {
115 | return new array_js_1.ArrayCoder(this.#getCoder(param.arrayChildren), param.arrayLength, param.name);
116 | }
BUNDLE ./index.js
Installed dev "@babel/plugin-proposal-private-methods": "^7.18.6"
and added to babel.config.js:
overrides: [
{
test: './node_modules/ethers',
plugins: [
["@babel/plugin-transform-private-methods", { "loose": true }]
]
}
]
from https://github.com/ethers-io/ethers.js/discussions/4309. But the problem remains.
Upvotes: 1
Views: 443