1

I initialized a new react native project with Amplify.

npm install -g @aws-amplify/cli
amplify configure
npm install -g expo-cli 
expo init RNAmplify
cd RNAmplify
amplify init
npm install aws-amplify aws-amplify-react-native @react-native-community/netinfo @react-native-async-storage/async-storage
import Amplify from 'aws-amplify'
import config from './aws-exports'
Amplify.configure(config)

And I keep getting this response when I reload the app. The aws-amplify, aws-amplify-react-native are present in the node_modules directory.

Unable to resolve module ./aws-exports from C:\Users\Masi\IdeaProjects\RNAmplify\App.js: 

None of these files exist:
  * aws-exports(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json)
  * aws-exports\index(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json)
Masi
  • 19
  • 2
  • 9

2 Answers2

1

Look in folder "src"

Yanov
  • 655
  • 7
  • 13
0

What helped me was that I actually needed to run amplify init which creates an amplify folder for you after you answer a few questions.

Uch
  • 94
  • 8
  • what exactly the solution of the problem is? Can u explain your answer? – William Dec 13 '22 at 10:53
  • 1
    So you won't have an aws-config file unless you run amplify init. When you install amplify cli, after navigating to your source folder, either running amplify init or running amplify add auth, should give you a config file. The issue here is that the user likely does not have that file existing in their base folder. – Uch Dec 22 '22 at 03:15