Cannot read property 'additionalAuthenticationProviders' of undefined
Note: If your issue/bug is regarding the AWS Amplify Console service, please log it in the Amplify Console GitHub Issue Tracker
Describe the bug
✖ There was an error initializing your environment.
Cannot read property 'additionalAuthenticationProviders' of undefined
TypeError: Cannot read property 'additionalAuthenticationProviders' of undefined
at getAppSyncConfig (/Users/rb365/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-frontend-ios/lib/frontend-config-creator.js:293:61)
at Object.keys.forEach (/Users/rb365/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-frontend-ios/lib/frontend-config-creator.js:69:11)
at Array.forEach (<anonymous>)
at getAWSConfigObject (/Users/rb365/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-frontend-ios/lib/frontend-config-creator.js:43:39)
at createAWSConfig (/Users/rb365/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-frontend-ios/lib/frontend-config-creator.js:20:24)
at Object.createFrontendConfigs (/Users/rb365/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-frontend-ios/index.js:27:10)
at AmplifyToolkit.<anonymous> (/Users/rb365/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/lib/extensions/amplify-helpers/on-category-outputs-change.js:65:64)
at step (/Users/rb365/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/lib/extensions/amplify-helpers/on-category-outputs-change.js:33:23)
at Object.next (/Users/rb365/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/lib/extensions/amplify-helpers/on-category-outputs-change.js:14:53)
at /Users/rb365/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/lib/extensions/amplify-helpers/on-category-outputs-change.js:8:71
To Reproduce amplify init select existing environment
Expected behavior no error
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: MacOS
Additional context upgraded CLI and it fails now on my project everything works on CLI 1.12.0
@rb365 Was there anything done prior to do a amplify init? Did you git clone an amplify project and then run amplify init?
@SwaySway
I didn't clone, I just updated CLI and tried changing environment with: amplify env checkout production
that failed with same error so I thought maybe i need to init project so I did amplify init and that failed too, I created new project from scratch and saw that backend-config.json looked different:
"api": {
"test": {
"service": "AppSync",
"providerPlugin": "awscloudformation",
"output": {
"authConfig": {
"additionalAuthenticationProviders": [
{
"authenticationType": "API_KEY",
"apiKeyConfig": {
"description": "test",
"apiKeyExpirationDays": 180
}
},
{
"authenticationType": "AWS_IAM"
}
],
"defaultAuthentication": {
"authenticationType": "AMAZON_COGNITO_USER_POOLS",
"userPoolConfig": {
"userPoolId": "authtest"
}
}
}
}
}
}
I tried adding authConfig in my old project but that didn't do anything, still fails with same issue
@SwaySway I just did clean clone and ran amplify init and it failed with same error. I downgraded amplify to 1.12.0 and it worked fine. I went to my JS part of the project and new amplify init works fine, it's just the iOS project that fails. There is an assumption that authConfig always exists in output which is false in older configs.
@rb365 Can you init the project in the iOS project using v1.1.12 - which works and then once you're able to init/pull the project in, you can upgrade the the latest version and just run amplify update api - walkthrough your options and your authConfig would be generated (all the configs would be automatically migrated at that point).
@kaustavghosh06 thanks! I still got it after I did that so what I did was changed schema to trigger changes to do amplify push and after I did amplify push it still gave me the error for the first push but after that it went away
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 for those types of questions.