Closed WolfWalter closed 10 months ago
I had the same error, but not in a PWA. I was using nuxt and while migrating from nuxt 2 to nuxt 3 changed the port from 8081 to 3000. Changing the port back to 8081 fixed it. Probably a CORS issue is not handled correctly by amplify. Oddly enough, Auth.signIn
sometimes still worked, while other times it didn't.
The error was caused at the exact same location in Client.js
.
I am using "aws-amplify": "^5.3.1",
With the release of the latest major version of Amplify (aws-amplify@>6), this issue should now be resolved! Please refer to our release announcement, migration guide, and documentation for more information.
Before opening, please confirm:
JavaScript Framework
Angular
Amplify APIs
Authentication
Amplify Categories
auth
Environment information
Describe the bug
When calling
await this.auth.signIn(this.loginDetails.email, this.loginDetails.password);
in a offline Angular 13 PWA. An error with the nameType Error
and with the messageCannot read properties of undefined (reading 'split')
is thrown. I tracked it down to this line: https://github.com/aws-amplify/amplify-js/blob/e8c905b46c325ff6e50d69e10f3491409ca9e921/packages/amazon-cognito-identity-js/src/Client.js#L114I can only reproduce the error when it is deployed as an PWA on S3. When I ran the app locally an
NetworError
is thrown.Expected behavior
Should throw a error with
err.code === NetworkError
.Reproduction steps
Code Snippet
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response