I'm running an expo react-native application with a dependent version
- "expo": "^49.0.0"
- system MAC M1 Venture 13.2.1 (22D68)
- Node version is v20.11.1
- npm version is 10.2.4
- npx version is 10.2.4
Have configured all the packages and plugins correctly even ./gradlew clean command is successful. But when running the application using the yarn android command on the emulator it throws a run time error and the below issue came for the react-native-reanimated package for syntax error.
Find the issue below,
error: SyntaxError: /Users/da/Desktop/Documents/apps/expoapps/mm/myapp/node_modules/react-native-reanimated/src/createAnimatedComponent/createAnimatedComponent.tsx: Unexpected token, expected "," (105:28) 103 | // @ts-ignore This is required to create this overload, since type of createAnimatedComponent is incorrect and doesn't include typeof FlatList 104 | export function createAnimatedComponent( 105 | component: typeof FlatList, | ^ 106 | options?: Options 107 | ): ComponentClass; 108 | ` Have the dependency version as,
- "react-native": "0.72.10",
- "react-native-reanimated": "^3.7.1",
and babel.config.js as follows as,
module.exports = function(api) { api.cache(true); return { presets: ['babel-preset-expo'], plugins: ['react-native-reanimated/plugin'], }; }; Also in the iOS platform, it fails with the react-native-reanimated package with the same error, and also, below is the iOS runtime error caught on the Simulator
iOS Bundling failed 12533ms error: SyntaxError: /Users/devendraahirwar/Desktop/Documents/apps/expoapps/mm/matrimoniallagnagathi/node_modules/react-native-reanimated/src/reanimated2/threads.ts: Unexpected token (235:47) 233 | 234 | return (...args) => 235 | runOnJS(runWorkletOnJS)( | ^ 236 | fun as WorkletFunction, 237 | ...args 238 | ); Any resolution to this?
Источник: https://stackoverflow.com/questions/780 ... ken-expect
Мобильная версия