Amplify-cli: 'amplify init' does not generate aws-exports.js

Created on 26 Aug 2018  路  8Comments  路  Source: aws-amplify/amplify-cli

Do you want to request a feature or report a bug? Bug

What is the current behavior?
Following AWS Amplify Getting started guide for react-native, after step 4 which is amplify init, this command completes successfully without generating an aws-exports.js file in the source folder nor anywhere.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

What is the expected behavior?
Expect aws-exports.js to be generated.

Which versions of Amplify CLI, and which OS are affected by this issue? Did this work in previous versions?
Amplify CLI 0.1.14
Node v10.2.0

Previously worked with awsmobile init

Also, noticed that if I run amplify configure project while switching type of app [android, ios, javascript] then I do successfully get an aws-exports.js in my source folder. But the content is rather lacking.

Most helpful comment

Did this ever get updated in the docs? The react native docs jump right into code referencing aws-exports, without mentioning the need to add storage and run publish first.

All 8 comments

@kwkecw Amplify init doesn't provision any resources for you which go in the aws_exports file. Once you add any of the resources using any of the category subcommands (for eg: amplify storage add) and run an amplify push, the resources will get provisioned in the cloud and the aws_exports.js file would be generated with the expected resources which could thereon be picked up by the Ampify JS lib or the SDKs(for native apps).

It appears that after adding some category, amplify push will update (and generate?) aws-exports.js, maybe its just a documentation issue.

Yeah, that is correct. Could you point me to the documentation which you referred to?

@kwkecw We'll have the docs updated. Thanks!

Did this ever get updated in the docs? The react native docs jump right into code referencing aws-exports, without mentioning the need to add storage and run publish first.

I had the same issue. What I was doing wrong was when I was setting my source destination during "amplify init", I was giving this "/src". So this is not the correct path as this means the initial destination of your partition, eg: D:/ or C:/.
I update the source destination to "src" only and it works, and now I have aws-export.js file in it.

I had the same issue. What I was doing wrong was when I was setting my source destination during "amplify init", I was giving this "/src". So this is not the correct path as this means the initial destination of your partition, eg: D:/ or C:/.
I update the source destination to "src" only and it works, and now I have aws-export.js file in it.

You can update it using "amplify update project"

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mwarger picture mwarger  路  3Comments

adriatikgashi picture adriatikgashi  路  3Comments

darrentarrant picture darrentarrant  路  3Comments

ffxsam picture ffxsam  路  3Comments

onlybakam picture onlybakam  路  3Comments