Open Bushuo opened 3 years ago
This loads
metro-babel-transformer
instead ofmetro-react-native-babel-transformer
.
Hmm.. do you know what's the difference between these two?
Sorry no. I just know that metro-babel-transformer
is the default string when console.logging babelTransformerPath
Thanks, @Bushuo. Adding customTransformer.js
to the root folder and replacing this line in metro.config.js
fixed it for me:
- babelTransformerPath: require.resolve('react-native-svg-transformer'),
+ babelTransformerPath: require.resolve('./customTransformer.js'),
Description
I use
react-native-reanimated@2.0.0-rc.0
which requires me to use a plugin for babel. Important to say is my project is a monorepo with yarn workspaces.If I use
the app crashes silently. Only
logcat
outputs a seemingly unrelated error caused by the plugin not being loaded.I fixed this by creating
This loads
metro-babel-transformer
instead ofmetro-react-native-babel-transformer
. The later is loaded byreact-native-svg-transformer
on RN >= 0.59I don't know the implications of loading
metro-babel-transformer
but it's the default string forbabelTransformerPath
so it seems right.Should I make a PR for this change?
Here is a link to the somewhat MVE repo where I could reproduce the crash https://github.com/Bushuo/reanimated2-monorepo-crash Quite large because I needed to experiment a little bit to find the cause of the crash...
Dependencies