Amplify Libraries

FeedbackFeedbackEditEditDiscord LogoChat with usWe'd love your feedback

Troubleshooting

Upgrading Amplify packages

When upgrading Amplify packages, it is important to make sure that there are no duplicate versions of Amplify packages in the node_modules folder tree as a result of the upgrade. Having multiple versions of packages can yield unexpected behavior as modules imported in your code might point to versions not configured by Amplify when calling Amplify.configure.

A likely scenario that could point to duplicate versions of packages is getting console messages like:

  • Amplify has not been configured correctly
  • Please make sure the Auth module is configured with a valid Cognito User Pool ID
  • User pool is not configured
  • No Auth module registered in Amplify

To prevent this situation, you can Check for duplicate versions, and if duplicate versions exists, then Upgrade Amplify packages.

Check for duplicate versions

The following commands will show you Amplify packages that appear multiple times in your node_modules folder. If the output is empty, it means that you don’t have duplicate versions of Amplify packages.

# Using YARN yarn list --pattern amplify | \ grep -o -e '@\?aws-amplify[^ ]*' | \ sort | uniq | \ sed -E 's/^(@?[^@]+).*$/\1/g' | \ uniq -d | sort

# Using YARN yarn list --pattern amplify | \ grep -o -e '@\?aws-amplify[^ ]*' | \ sort | uniq | \ sed -E 's/^(@?[^@]+).*$/\1/g' | \ uniq -d | sort

# Using NPM npm ls -all 2>/dev/null | \ grep -o -e '@\?aws-amplify[^ ]*' | \ sort | uniq | \ sed -E 's/^(@?[^@]+).*$/\1/g' | \ uniq -d | sort

# Using NPM npm ls -all 2>/dev/null | \ grep -o -e '@\?aws-amplify[^ ]*' | \ sort | uniq | \ sed -E 's/^(@?[^@]+).*$/\1/g' | \ uniq -d | sort

# Using YARN yarn list --pattern amplify | Select-String -Pattern '(@?aws\-amplify[^@]*).*(?<!deduped)$' | %{$_.Matches.Groups[1].value} | Group-Object | Where-Object { $_.Count -gt 1 } | Select-Object -ExpandProperty Name | Sort-Object

# Using YARN yarn list --pattern amplify | Select-String -Pattern '(@?aws\-amplify[^@]*).*(?<!deduped)$' | %{$_.Matches.Groups[1].value} | Group-Object | Where-Object { $_.Count -gt 1 } | Select-Object -ExpandProperty Name | Sort-Object

# Using NPM npm ls -all 2>$null | Select-String -Pattern '(@?aws\-amplify[^@]*).*(?<!deduped)$' | %{$_.Matches.Groups[1].value} | Group-Object | Where-Object { $_.Count -gt 1 } | Select-Object -ExpandProperty Name | Sort-Object

# Using NPM npm ls -all 2>$null | Select-String -Pattern '(@?aws\-amplify[^@]*).*(?<!deduped)$' | %{$_.Matches.Groups[1].value} | Group-Object | Where-Object { $_.Count -gt 1 } | Select-Object -ExpandProperty Name | Sort-Object

Upgrade Amplify packages

If you want to update all Amplify packages to the latest versions from npm, run the following command, it will also make sure that only one version of every Amplify package is installed.

# Using YARN yarn upgrade --latest --pattern aws-amplify

# Using YARN yarn upgrade --latest --pattern aws-amplify

# Using NPM npx npm-check-updates -i '/@?aws-amplify/' && npm update

# Using NPM npx npm-check-updates -i '/@?aws-amplify/' && npm update

# Using YARN yarn upgrade --latest --pattern aws-amplify

# Using YARN yarn upgrade --latest --pattern aws-amplify

# Using NPM npx npm-check-updates -i '/@?aws-amplify/' && npm update

# Using NPM npx npm-check-updates -i '/@?aws-amplify/' && npm update
Discord Logo
Amplify open source, documentation and community are supported by Amazon Web Services © 2021, Amazon Web Services, Inc. and its affiliates. All rights reserved. View the site terms and privacy policy.
    Flutter and the related logo are trademarks of Google LLC. We are not endorsed by or affiliated with Google LLC.