Closed songdedku closed 1 month ago
my babel config
module.exports = { presets: ['module:metro-react-native-babel-preset'], plugins: [ [ 'babel-plugin-root-import', { rootPathPrefix: '~', rootPathSuffix: 'src', }, ], 'nativewind/babel', 'react-native-reanimated/plugin', [ '@babel/plugin-transform-class-properties', {loose: true}, // Ensure loose mode is set to true ], [ '@babel/plugin-transform-private-methods', {loose: true}, // Ensure loose mode is set to true ], [ '@babel/plugin-transform-private-property-in-object', {loose: true}, // Ensure loose mode is set to true ], ], };
Hi @songdedku,
please provide a minimal reproduction repository where the error is happening, otherwise I won't be able to help you with this issue.
error when I have import react-native-reanimated-carousel or @react-navigation/drawer on screen @jbroma
@songdedku please make a repo that I can clone so I can help you, thanks!
I think it might be because of this warning.
https://github.com/songdedku/testRepack.git @jbroma , thanks!
I'm tired of fixing it. Please help me. Thank you. @jbroma
Hi @songdedku, we investigated your issue. The warning you mentioned is harmless, however, there exist a few problems in your setup:
webpack.config.mjs#136-143
you are overriding the default values for the container's react & RN packages based on a STANDALONE
env var you are loading. If you start the project using the start
command defined in package.json
, it will not evaluate to true
, effectively making react & RN eager: false
, which is prohibited as mentioned in the docs in the Limitations section. Since React Native requires JavaScript code to synchronously perform initialization, it would break its initialization. To fix the start
command, you should prefix the start
script with STANDALONE=1
or STANDALONE=true
. RN CLI also launches the bundler automatically if you run the app without having run the bundler beforehand, causing it to also run with the STANDALONE
env var not being defined - thus, you should properly handle that in the code.react-native-gesture-handler
to 2.19.0
plugins: ['react-native-reanimated/plugin'],
to you babel.config.js
.After applying both changes, running the start
script first and then the app, your project worked properly.
Describe the bug
System Info
Re.Pack Version
4.2.0
Reproduction
No response
Steps to reproduce
No response