-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Circular dependencies introduced with 6.10.0 to @aws-amplify/auth #14150
Comments
Hey @mia-iofinnet, thank you for opening this issue. We are looking into this on our side. Are you able to provide any additional details about the build configuration for your application? Thanks! |
I was able to replicate the issue described above when I enabled the experimental react compiler in an expo application. Are you using react compiler as well? As a temporary workaround, are you able to disable it? Regardless, we will look into cleaning up these circular dependencies. |
Of course, no worries. 😊 |
Hello, I'm not sure if the circular dependencies are causing the problem here, but I have the same issue with trying to sign in with SRP (default auth flow) where I get
I don't have the experimental react component enabled and I've been getting this error on version 6.6.0 as well before updating to 6.12 only for the problem to persist. Let me know if there are more info I should provide. I'd really appreciate your help |
@aaBoustani, thank you for the additional context here. The circular dependencies originally reported in this issue seemed to be tied to the use of the experimental react compiler in an expo application. We wouldn't consider that a bug on our side, as we can't ensure the use of third party experimental items won't result in unexpected behavior. But your use case is something we'll investigate further to determine if the root cause of both these issues is a bug or not. Are you saying the TypeError you're getting when using SRP auth flows only began as of v6.6+ but wasn't happening in lower versions? And at any point of upgrading since v6.60, have you cleared our your |
@cwomack, I did a lot of investigating and I tried different versions to try to pinpoint where the problem is. Always deleting node_modules and yarn.lock and building without cache. The problem is there when using the latest versions: I tried using v6.6.0 with aws-aplify/auth v6.8 from an older yarn.lock from the latest version of our app that worked, but was still getting the same error. Finally, I was able to make it work by installing v6.6.0 without the carat (^) and it was installed with the following deps: Then I tried to trace the latest version in which it would work, so I first tried v6.10 (The error was still there): But in v6.9.0, the error is gone and was able to log in: I hope this was helpful. I included the deps from yarn.lock in case the submodule versions are relevant. Let me know if you need more info or if there's something I should try. Note that I didn't change the code at all, I simply changed the aws-amplify version, then deleted node_modules and yarn.lock before installing again and running |
Thanks for the detailed information @aaBoustani. Can you share the output of the following command? |
@jjarvisp certainly!
|
Thanks for sharing @aaBoustani. Nothing is jumping out at me in that output and I'm still unable to reproduce on my end. I'll keep trying but would you mind sharing some of your build configuration files i.e. babel config, app.json, etc.? Please redact anything sensitive if necessary. |
@jjarvisp sorry for the delay, here are the config files: app.json
tsconfig.json
metro.config.js
babel.config.js
eas.json
I think this is all, if there's a missing config, please let me know. |
Hi @aaBoustani, thanks for the detailed config info. In this case, it looks like the issue is caused by enabling experimental import support in the metro bundler. Are you able to disable this as a temporary workaround? |
@jjarvisp disabling the feature works! Thank you very much! |
Thanks for verifying @aaBoustani! We're working on a fix for this and will update here when we have more information. |
[email protected] has been released and should include a fix for eliminating the Auth circular dependencies mentioned above from the library. Please let us know if this helps to mitigate the issues you have been experiencing, thanks! |
Before opening, please confirm:
JavaScript Framework
React Native
Amplify APIs
Authentication
Amplify Version
v6
Amplify Categories
auth
Backend
None
Environment information
Describe the bug
We were seeing and error
TypeError: setActiveSignInUsername is not a function (it is undefined)
when trying to update to version6.10.0
ofaws-amplify
or later.After some debugging, we noticed that all the items imported from
src/providers/cognito/utils/signInHelpers.ts
intosrc/client/flows/shared/handlePasswordSRP.ts
were undefined at runtime.The we ran the following command to analyze circular dependencies in the project:
Whereas when using
6.9.0
, the output of that command is empty, when switching to6.10.0
it becomes:Expected behavior
6.9.0
to6.10.0
.npx dpdm -T --no-tree --no-warning packages/auth/src/index.ts
against the source of this repo does not report any circular dependencies.Reproduction steps
[email protected]
.npx dpdm -T --no-tree --no-warning packages/auth/src/index.ts
. No circular dependencies will be reported.[email protected]
or any other later version.npx dpdm -T --no-tree --no-warning packages/auth/src/index.ts
. Circular dependencies will be reported:Code Snippet
// Put your code below this line.
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
The text was updated successfully, but these errors were encountered: