Compile error: Unknown option: .pre with react-native-reanimated/plugin
See original GitHub issueDescription
Since I installed react-native-reanimated, my application won’t start. I tried several versions of react-native or Babel, but nothing works.
error: index.js: [BABEL] W:\folders\project\index.js: Unknown option: .pre. Check out https://babeljs.io/docs/en/babel-core/#options for more information about options.
Expected behavior
When I add the react-native-reanimated/plugin plugin in the babel.config.js file, my application doesn’t want to run anymore.
Actual behavior & steps to reproduce
- Run:
npx react-native init MyApp --template @ui-kitten/template-ts. - Run:
npm install react-native-reanimated. - Add babel plugin to babel.config.js.
- Change
enableHermestotrue. - Change MainApplication.java.
- Run:
react-native run-androidor with--reset-cache.
Snack or minimal code example
babel.config.js
module.exports = {
presets: [
'module:metro-react-native-babel-preset',
'react-native-reanimated/plugin',
],
};
index.js
import { AppRegistry } from 'react-native';
import { name as appName } from './app.json';
import App from './src/App';
AppRegistry.registerComponent(appName, () => App);
App.tsx (I already tried to remove all routes and imports)
...
import 'react-native-gesture-handler';
export default (): React.ReactFragment => {
return (
<>
<IconRegistry icons={EvaIconsPack} />
<ApplicationProvider {...eva}>
<NavigationContainer>
<RootStack.Navigator screenOptions={screenOptions}>
<RootStack.Screen name="Home" component={HomeScreen} />
<RootStack.Screen name="Editor" component={EditorScreen} />
</RootStack.Navigator>
</NavigationContainer>
</ApplicationProvider>
</>
);
};
Package versions
- React Native: 0.66.3
- React Native Reanimated: 2.3.0-beta.4
- NodeJS: 16.8.0
- Xcode: None
- Java & Gradle: Java 8 & Gradle 6.8
Affected platforms
- Android
- iOS
- Web
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6
Top Results From Across the Web
Compilation error with react-native-reanimated and babel
js: [BABEL] W:\folders\project\index.js: Unknown option: .pre. Check out https://babeljs.io/ ...
Read more >Installation | React Native Reanimated - Software Mansion
After adding the react-native-reanimated/plugin to your project you may encounter a false-positive "Reanimated 2 failed to create a worklet" error.
Read more >Package babel Error: Unknown option `francais' - TeX
The complete error message is: ! Package babel Error: Unknown option `francais'. Either you misspelled it (babel) or the language definition ...
Read more >Module build failed: ReferenceError [BABEL] Unknown option
gulp does not work: Module build failed: ReferenceError [BABEL] Unknown option: direct.presets. We use Laravel 5.3.x and have elixir for build assets.
Read more >Invalid ProGuard configuration file. Unknown option '-if' in line 16
Unknown option '-if' in line 16. Hi ,. I am new to Xamarin Development. While i build xamarin application i get the following...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I put
react-native-reanimated/pluginin"presets", instead in"plugins". Check if you haven’t done the same.im glad you made this mistake, same here 😄