Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Auth Error Name #14128

Open
MattWlodarski opened this issue Jan 9, 2025 · 2 comments
Open

Incorrect Auth Error Name #14128

MattWlodarski opened this issue Jan 9, 2025 · 2 comments
Assignees
Labels
Core Related to core Amplify issues question General question transferred This issue was transferred from another Amplify project

Comments

@MattWlodarski
Copy link

Environment information

System:
  OS: macOS 14.6.1
  CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
  Memory: 38.09 MB / 64.00 GB
  Shell: /bin/zsh
Binaries:
  Node: 20.18.1 - /usr/local/bin/node
  Yarn: undefined - undefined
  npm: 10.8.2 - /usr/local/bin/npm
  pnpm: undefined - undefined
NPM Packages:
  @aws-amplify/auth-construct: 1.5.1
  @aws-amplify/backend: 1.13.0
  @aws-amplify/backend-auth: 1.4.2
  @aws-amplify/backend-cli: 1.4.6
  @aws-amplify/backend-data: 1.4.0
  @aws-amplify/backend-deployer: 1.1.13
  @aws-amplify/backend-function: 1.12.0
  @aws-amplify/backend-output-schemas: 1.4.0
  @aws-amplify/backend-output-storage: 1.1.4
  @aws-amplify/backend-secret: 1.1.5
  @aws-amplify/backend-storage: 1.2.4
  @aws-amplify/cli-core: 1.2.1
  @aws-amplify/client-config: 1.5.5
  @aws-amplify/deployed-backend-client: 1.5.0
  @aws-amplify/form-generator: 1.0.3
  @aws-amplify/model-generator: 1.0.12
  @aws-amplify/platform-core: 1.5.1
  @aws-amplify/plugin-types: 1.7.0
  @aws-amplify/sandbox: 1.2.9
  @aws-amplify/schema-generator: 1.2.6
  aws-amplify: 6.12.0
  aws-cdk: 2.174.1
  aws-cdk-lib: 2.171.1
  typescript: 5.5.4
No AWS environment variables
No CDK environment variables

Data packages

[email protected] /Users/mattwlodarski/Documents/js-master-repo-2
├─┬ @aws-amplify/[email protected]
│ └─┬ @aws-amplify/[email protected]
│   └── @aws-amplify/[email protected]
└─┬ @aws-amplify/[email protected]
  └─┬ @aws-amplify/[email protected]
    └── @aws-amplify/[email protected]

Description

If you trigger an auth error like trying to sign in with the incorrect password, you get an error name (NotAuthorizedException for this example). If you trigger the same error again without refreshing the app,
you get a different error name in the console (TypeError) even though the network returns the same error type. Seems to be an issue with one of the amplify client packages. I attached a screenshot from my console.
type error

@MattWlodarski MattWlodarski added the pending-triage Issue is pending triage label Jan 9, 2025
@AnilMaktala AnilMaktala added the transferred This issue was transferred from another Amplify project label Jan 9, 2025
@AnilMaktala
Copy link
Member

Hi @MattWlodarski, Thanks for raising this. Transferring this to JS repo for better assistance.

@AnilMaktala AnilMaktala transferred this issue from aws-amplify/amplify-category-api Jan 9, 2025
@github-actions github-actions bot added the pending-maintainer-response Issue is pending a response from the Amplify team. label Jan 9, 2025
@AllanZhengYP
Copy link
Member

Hi @MattWlodarski

Thanks for raising this. It seems like the error stems from this line:

// Hack for making the custom error class work when transpiled to es5
// TODO: Delete the following 2 lines after we change the build target to >= es2015
this.constructor = AmplifyError;

However, we cannot reproduce this issue. I notice you are using zonejs from the stack trace. It may cause unwanted effect on the this scope. Can you try if you can still reproduce this issue without zone.js?

@github-actions github-actions bot removed the pending-maintainer-response Issue is pending a response from the Amplify team. label Jan 9, 2025
@AllanZhengYP AllanZhengYP added question General question pending-maintainer-response Issue is pending a response from the Amplify team. Core Related to core Amplify issues and removed pending-triage Issue is pending triage pending-maintainer-response Issue is pending a response from the Amplify team. labels Jan 9, 2025
@AllanZhengYP AllanZhengYP self-assigned this Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Related to core Amplify issues question General question transferred This issue was transferred from another Amplify project
Projects
None yet
Development

No branches or pull requests

3 participants