Amplify-console: amplifyPush ignores SourceDir and puts aws-exports.js to a wrong path

Created on 27 Dec 2019  路  5Comments  路  Source: aws-amplify/amplify-console

Describe the bug
I have the following amplify/.config/project-config.json

{ 
    "projectName": "zzz", 
    "version": "2.0", 
    "frontend": "javascript", 
    "javascript": { 
        "framework": "react", 
        "config": { 
            "SourceDir": "frontend/src", 
            "DistributionDir": "frontend/build", 
            "BuildCommand": "npm run-script build", 
            "StartCommand": "npm run-script start" 
        } 
    }, 
    "providers": [ 
        "awscloudformation" 
    ] 
}

When I do amplify push on my machine it works fine, the aws-exports.js is created where SourceDir points to. When amplifyPush is executed during the build in the console it generates the file in ./src, ignoring SourceDir setting.

Amplify CLI Version
4.6.0

backend bug

All 5 comments

I am running into the same issue. I can confirm amplifyPush --simple places the file into ./src

Same here. Added this temporary fix in my amplify.yml file for now before my frontend build:

NOTE: I use src/frontend but yours may be simply src. The info is under amplify/.config/project-config.json under SourceDirectory key

- test -f src/aws-exports.js && cp src/aws-exports.js src/frontend/ # temporary fix: https://github.com/aws-amplify/amplify-console/issues/342

@asyschikov @BabyDino can you please try again and let us know if the issue persists?

Looks good! Thank you! :)

Just upgraded to 4.13.1, kicked a new build and it's now fixed.

Thank you @kahdojay and team

Was this page helpful?
0 / 5 - 0 ratings