Expo error Unexpected token '{'. import call expects exactly one argument

Viewed 25

It was working fine until I installed some packages with --legacy-peer-deps. then I uninstalled those packages but the error remained

my package.json:

{
  "name": "nativefetchdemo",
  "version": "1.0.0",
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "eject": "expo eject"
  },
  "dependencies": {
    "@react-native-async-storage/async-storage": "^1.17.7",
    "@react-native-community/masked-view": "^0.1.11",
    "@react-native-material/core": "^1.3.7",
    "@react-navigation/native": "^6.0.11",
    "@react-navigation/stack": "^6.2.2",
    "axios": "^0.27.2",
    "expo": "~45.0.0",
    "expo-build-properties": "~0.2.0",
    "expo-device": "~4.2.0",
    "expo-notifications": "~0.15.4",
    "expo-permissions": "~13.2.0",
    "expo-status-bar": "~1.3.0",
    "react": "17.0.2",
    "react-dom": "17.0.2",
    "react-native": "0.68.2",
    "react-native-gesture-handler": "~2.2.1",
    "react-native-paper": "^4.12.4",
    "react-native-reanimated": "~2.8.0",
    "react-native-safe-area-context": "4.2.4",
    "react-native-screens": "~3.11.1",
    "react-native-svg-transformer": "^1.0.0",
    "react-native-web": "0.17.7",
    "react-redux": "^8.0.2",
    "redux": "^4.2.0",
    "redux-devtools-extension": "^2.13.9",
    "redux-logger": "^3.0.6",
    "redux-persist": "^6.0.0",
    "redux-thunk": "^2.4.1",
    "tailwindcss-react-native": "^1.7.10",
    "twrnc": "^3.3.3"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "tailwindcss": "^3.1.8"
  },
  "private": true
}

I installed the packages which made this error appear. It was fine when only the current packages were there. but now the error won' go away.

Idk if it caused it but I used --legacy-peer-deps command line when installing packages because some packages had different versions of react

my babel.config.js:

module.exports = function (api) {
  api.cache(true);
  return {
    presets: ['babel-preset-expo'],
    plugins: [
      'tailwindcss-react-native/babel',
      'react-native-reanimated/plugin',
    ],
    env: {
      production: {
        plugins: ['react-native-paper/babel', 'react-native-reanimated/plugin'],
      },
    },
  };
};

0 Answers
Related