Question:
I am doing the walkthrough for building a full stack app with Amplify and am stuck on the third module, adding auth. I followed all the instructions to a T but my build is failing saying there are invalid feature flags like so.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# Starting phase: build 2022-02-14T02:47:02.527Z [INFO]: [31mInvalid feature flag configuration[39m 2022-02-14T02:47:02.530Z [INFO]: [31mThese feature flags are defined in the "amplify/cli.json" configuration file and are unknown to the currently running Amplify CLI:[39m [31m - project[39m [31m - graphqltransformer.transformerversion[39m [31m - graphqltransformer.suppressschemamigrationprompt[39m [31m - graphqltransformer.securityenhancementnotification[39m [31m - graphqltransformer.showfieldauthnotification[39m [31m - auth.useenabledmfas[39m [31mThis issue likely happens when the project has been pushed with a newer version of Amplify CLI, try updating to a newer version.[39m [31mEnsure that the CI/CD pipeline is not using an older or pinned down version of Amplify CLI.[39m [31mLearn more about feature flags: https://docs.amplify.aws/cli/reference/feature-flags[39m 2022-02-14T02:47:02.539Z [ERROR]: !!! Build failed 2022-02-14T02:47:02.539Z [ERROR]: !!! Non-Zero Exit Code detected 2022-02-14T02:47:02.539Z [INFO]: # Starting environment caching... 2022-02-14T02:47:02.540Z [INFO]: # Uploading environment cache artifact... 2022-02-14T02:47:02.602Z [INFO]: # Environment caching completed Terminating logging... |
Here is my amplify/cli.json
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
{ "features": { "graphqltransformer": { "addmissingownerfields": true, "improvepluralization": false, "validatetypenamereservedwords": true, "useexperimentalpipelinedtransformer": true, "enableiterativegsiupdates": true, "secondarykeyasgsi": true, "skipoverridemutationinputtypes": true, "transformerversion": 2, "suppressschemamigrationprompt": true, "securityenhancementnotification": false, "showfieldauthnotification": false }, "frontend-ios": { "enablexcodeintegration": true }, "auth": { "enablecaseinsensitivity": true, "useinclusiveterminology": true, "breakcirculardependency": true, "forcealiasattributes": false, "useenabledmfas": true }, "codegen": { "useappsyncmodelgenplugin": true, "usedocsgeneratorplugin": true, "usetypesgeneratorplugin": true, "cleangeneratedmodelsdirectory": true, "retaincasestyle": true, "addtimestampfields": true, "handlelistnullabilitytransparently": true, "emitauthprovider": true, "generateindexrules": true, "enabledartnullsafety": true }, "appsync": { "generategraphqlpermissions": true }, "latestregionsupport": { "pinpoint": 1, "translate": 1, "transcribe": 1, "rekognition": 1, "textract": 1, "comprehend": 1 }, "project": { "overrides": true } } } |
I updated node, aws-amplify, and amplify all to the newest versions. What is the problem here?
Answer:
It seems to be a different version of amplify cli between the aws build image and your machine.
Check your version of amplify cli :
1 2 |
$ amplify --version |
And override the version of amplify CLI in the build image :
AWS Amplify console -> Build Settings -> Build Image Settings -> Live package updates -> Amplify CLI