EAS build fails iOS node_modules/react-native/index.js

  • Managed Workflow
  • eas-cli v.0.35.0

Hi everyone,
I’m trying to do an eas build --platform ios and it fails with this error:

:x: Metro encountered an error:
SyntaxError: /Users/expo/workingdir/build/mobileApp/node_modules/react-native/index.js: Unexpected token, expected “{” (14:7)
12 |
13 | // Components
14 | import typeof AccessibilityInfo from ‘./Libraries/Components/AccessibilityInfo/AccessibilityInfo’;
| ^
15 | import typeof ActivityIndicator from ‘./Libraries/Components/ActivityIndicator/ActivityIndicator’;
16 | import typeof Button from ‘./Libraries/Components/Button’;
17 | import typeof DatePickerIOS from ‘./Libraries/Components/DatePicker/DatePickerIOS’;

Did anyone encountered the issue or have a clue on how to address that?

Thanks in advance

also, seems to be an issue with your project’s babel config. [Bug]: babel-register preset-env not applied in node_modules · Issue #13895 · babel/babel · GitHub

Thanks @brents .

So actually, the issue was due to the “react-native-reanimated/plugin” in the babel config, the plugin array containing the reanimated plugin must be put prior to the presets line.

Hope it can help if someone encounters the same issue

1 Like