Closed Kevinberg closed 3 years ago
### aws.exports.js
/ eslint-disable / // WARNING: DO NOT EDIT. This file is automatically generated by AWS Amplify. It will be overwritten.
const awsmobile = { "aws_project_region": XXXXX "aws_cognito_identity_pool_id": XXXXX", "aws_cognito_region": "XXXXX", "aws_user_pools_id": "XXXX", "aws_user_pools_web_client_id": "XXXX", "oauth": {} };
export default awsmobile;
{ "name": "home", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", "start": "react-native start", "test": "jest", "lint": "eslint ." }, "dependencies": { "@aws-amplify/api": "^3.2.30", "@aws-amplify/pubsub": "^3.2.28", "@react-native-community/netinfo": "^6.0.0", "amazon-cognito-identity-js": "^4.6.0", "aws-amplify": "^3.3.27", "react": "17.0.1", "react-native": "0.64.0" }, "devDependencies": { "@babel/core": "^7.12.9", "@babel/runtime": "^7.12.5", "@react-native-community/eslint-config": "^2.0.0", "babel-jest": "^26.6.3", "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.64.0", "react-test-renderer": "17.0.1" }, "jest": { "preset": "react-native" } }
import React from 'react'; import {Text, View, StyleSheet} from 'react-native'; import Amplify from 'aws-amplify'; import {Authenticator} from 'aws-amplify-react-native';
import awsmobile from './src/aws-exports'; Amplify.configure(awsmobile);
export default function App() { return (
); }
const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', }, });
Hi @Kevinberg ! 👋 Is this the documentation/tutorial you've been following to set up Amplify in a React Native project?
https://docs.amplify.aws/start/getting-started/installation/q/integration/react-native
Hi @chrisbonifacio , Yes I did. Finally I was able to make it work, somehow my git stopped working. Thanks for your response!
No problem! Glad you were able to figure it out :)
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server *-help
channels or Discussions for those types of questions.
Before opening, please confirm:
JavaScript Framework
React Native
Amplify APIs
Authentication
Amplify Categories
auth
Environment information
Describe the bug
Hi There,
I am receiving a syntax Error that aws-amplify could not be found within the project. When trying to import Amplify and awsmobile/exports from the src folder.
I followed step by step the process described in AWS amplify's instructions till the amplify push part. See screenshots of my package.json ,
Expected behavior
Being able to import Amplify and awsmobile
Reproduction steps
All steps in the amplify docs
Code Snippet
Log output
aws-exports.js
/ eslint-disable / // WARNING: DO NOT EDIT. This file is automatically generated by AWS Amplify. It will be overwritten.
const awsmobile = { "aws_project_region": "XXXX", "aws_cognito_identity_pool_id": "XXXXX", "aws_cognito_region": "XXXXX", "aws_user_pools_id": "XXXX", "aws_user_pools_web_client_id": "XXXX", "oauth": {} };
export default awsmobile;
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response