Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to resolve module ./src/aws-exports in demo app #669

Closed
vomc opened this issue Apr 16, 2018 · 16 comments
Closed

Unable to resolve module ./src/aws-exports in demo app #669

vomc opened this issue Apr 16, 2018 · 16 comments
Labels
investigating This issue is being investigated

Comments

@vomc
Copy link

vomc commented Apr 16, 2018

I am reporting a bug in the aws react-native starter demo app: https://github.com/aws-samples/aws-mobile-react-native-starter

Following all steps here verbatim in terms of install and config and then doing npm run ios.

App builds and then I get the ios simulator with an iPhone 6 open and a confirmation that the build succeeded.

However then when the app starts I get that typical red reactNative error screen saying that the app was could not resolve /Users/myCompName/Documents/awsTestApp/awsChat/src/aws-exports as a folder: it did not contain a package, nor an index file

screen shot 2018-04-16 at 2 27 03 pm
screen shot 2018-04-16 at 2 27 06 pm

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than AWS Amplify.

What is the expected behavior?

Not sure but I assumed the demo app would just work???

Which versions of Amplify, and which browser / OS are affected by this issue? Did this work in previous versions?

You can turn on the debug mode to provide more info for us by setting window.LOG_LEVEL = 'DEBUG'; in your app.

@richardzcode richardzcode added the investigating This issue is being investigated label Apr 16, 2018
@richardzcode
Copy link
Contributor

Hey @vomc , I just tried to follow steps and had no problem running the starter. This is what I did:

npm install -g awsmobile-cli@latest
awsmobile start rn-starter react-native
cd rn-starter
npm install
npm run ios

Could you check if you have src/aws-exports.js file in project folder?

One possible cause is maybe if you are having older version of awsmobile-cli. Could you try npm install -g awsmobile-cli@latest and see if it works?

@vomc
Copy link
Author

vomc commented Apr 16, 2018

Ok, let me try with awsmobile-cli@latest... Though I did just install it for the first time yesterday.

@richardzcode
Copy link
Contributor

is there a src/aws-exports.js file? it contains AWS configurations

@vomc
Copy link
Author

vomc commented Apr 16, 2018

Yup that was it. I can confirm that there is now a src/aws-exports.js and the app launches from the simulator. Thanks for the help!

@vomc vomc closed this as completed Apr 16, 2018
@vomc vomc reopened this Apr 16, 2018
@vomc vomc closed this as completed Apr 17, 2018
@matias91
Copy link

matias91 commented May 4, 2018

Sorry to revive this, but I'm having the same issue.
Already tried to make a fresh install with npm install -g awsmobile-cli@latest and create again the project, but aws-exports.js still is missing.
Just to understand better, when is this file created?
Because here is missing too: https://github.com/aws-samples/aws-mobile-react-native-starter/tree/master/client/src

Thanks in advance.

@vomc
Copy link
Author

vomc commented May 4, 2018

Hmm interesting. Maybe try to do an npm update ? It should create an aws-exports.js file in your src folder AFAIK

@anothercoder2
Copy link

anothercoder2 commented Jul 3, 2018

Same problem don't see the aws-export.js tried npm install -g awsmobile-cli@latest and npm update.
I am running the app on windows.
Thanks

@elorzafe
Copy link
Contributor

elorzafe commented Jul 3, 2018

@matias91 aws-exports.js is created after you run awsmobile init, and gets updated after running awsmobile push or awsmobile pull. The file is stored on the location you specify as src folder during init.

@anothercoder2
Copy link

My problem was I just ran the "awsmobile start my-project react-native" command and did not download the git code in the folder. That resolved the error but now facing a new issue:

Bundling index.android.js [development, non-minified, hmr disabled]
error: bundling failed: "Unable to resolve module theme from C:\\JS\\react\\a wstarter\\src\\Screens\\First.js: Module does not exist in the module map\n\nTh
is might be related to https://github.com/facebook/react-native/issues/4968\nTo
resolve try the following:\n 1. Clear watchman watches: watchman watch-del-all .\n 2. Delete the node_modules folder: rm -rf node_modules && npm install.
\n 3. Reset packager cache: rm -fr $TMPDIR/react-* or npm start -- --reset-c ache."

@Asautali
Copy link

Asautali commented Aug 1, 2018

I have the same problem for a week, I have tried to do everything in this thread and uninstall and reinstall everything. The aws-exports.js file does not appear anywhere, any ideas?

@scrapex
Copy link

scrapex commented Aug 17, 2018

Same here. aws-exports.js does not appear.
Using
"aws-amplify": "^1.0.6",
"aws-amplify-react-native": "^1.0.6",

@ericathegreat
Copy link

@Asautali @scrapex It looks like there was a change which went in about a month ago. aws-exports.js only gets generated after syncing to cloud. If you run 'amplify publish' it should pop into existence. :)

@ericathegreat
Copy link

aws-amplify/amplify-cli#23 << See here for details

@scrapex
Copy link

scrapex commented Aug 27, 2018

Thanks Erica. Also seems like awsmobile cli has moved/renamed to amplify cli...

@tetreault
Copy link

Thanks @ericathegreat thats helpful. Amazon is so great at making these services but does such a poor job writing their docs haha. One would think this is mentioned, because in the react native docs for amplify it jumps right into code referencing aws-exports.

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
investigating This issue is being investigated
Projects
None yet
Development

No branches or pull requests

9 participants