React Native - Class private methods are not enabled #4309
-
Ethers Version6.70. Search Termsreact native Describe the Problemwhen running
I would like NOT to add Code SnippetNo response Contract ABINo response ErrorsNo response EnvironmentReact Native/Expo/JavaScriptCore Environment (Other)No response |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments 17 replies
-
Is this a restriction of React Native? JavaScriptCore supports private members… What does the transform component break? I know with older versions of Angular there was a bug in the transform; is that the issue you are having? Private members are used in many places to prevent meddling with internal state. :) |
Beta Was this translation helpful? Give feedback.
-
forgot to mention, react-native version after adding babel plugin this is the issue I was having: I was able to use solution provided here: #3996 (comment)
|
Beta Was this translation helpful? Give feedback.
-
Awesome, so that resolved the issue then? I'm going to move this to discussions to assist those in the future that may happen across the same issue. Thanks! :) |
Beta Was this translation helpful? Give feedback.
-
A similar problem happened when upgrading from v5.7 to v6.7:
The solution provided above (overrides: in babel.config.js) didn't work. |
Beta Was this translation helpful? Give feedback.
-
I have the same issue, and the above solution works for me |
Beta Was this translation helpful? Give feedback.
-
I'm having a similar issue. node_modules/ml-matrix/matrix.js: /Users/pablo/Development/glik-android-react/node_modules/ml-matrix/matrix.js: Class private methods are not enabled. Please add
i did the things in your solution @Overtorment , but nothing really happens so i cant run my ios app! im using:
|
Beta Was this translation helpful? Give feedback.
-
The provided solution appears functional:
However, when using |
Beta Was this translation helpful? Give feedback.
-
install these packages and then replace code a mentioned below, if babel.config.js not found in root, then create this file replace babel.config.js with module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: ['react-native-paper/babel', '@babel/plugin-transform-private-methods', '@babel/plugin-proposal-class-properties'],
};
|
Beta Was this translation helpful? Give feedback.
-
inside bable.config file add this code |
Beta Was this translation helpful? Give feedback.
forgot to mention, react-native version
0.71.10
metro-react-native-babel-preset
version0.73.9
(not sure if its important)after adding babel plugin this is the issue I was having:
I was able to use solution provided here: #3996 (comment)
(added override to babel plugin)