-
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
Error importing Auth after upgrading NX 16 and RN 0.72.3 #11817
Comments
Hello, @gillicarmon and thanks for creating this issue. If you recently made the update from v4.2.9 of Amplify to the most recent v5.3.8, can you see if taking the following steps resolves the issue:
|
Thank you for the quick response. After the first 3 steps, the error remained. After changing version to v5.3.6 I was able to import Auth, but now I'm getting the same error after calling The error:
|
I have a similar issue after upgrading to React Native 0.72.3. I am using
It is thrown when attempting to call: const awsCryptoHash = new Sha256(); That is called from the |
@gillicarmon, thank you for the additional information and rolling back to verify! @david-gettins, this is also very helpful to know it's happening when using the Would both of you mind trying an upgrade to v5.3.10 of Amplify (latest version)? We've implemented quite a few changes in the last few versions since v5.3.6. If this does not resolve the issues, then I'll have some further follow up questions on the Nx and React Native side... but trying to see if we can isolate these issues on the Amplify side first. |
@cwomack I'll try that over the weekend and get back to you. |
Having this exact same issue with importing Amplify.
Wasn't an upgrade in my case but a fresh expo app with nx, to which I added aws-amplify@latest. |
I have updated to the latest |
same error here after nx/react-native upgrade:
also upgrading to recommended versions as described above did not resolve the issue for me:
|
Update: According to the docs this option will cause Metro to read the exports from I'm not sure whether this is the cause or just a workaround, but setting option
@gillicarmon or @david-gettins, can you maybe confirm this? |
@rudgal I'll give it a try and get back to you |
In testing it locally, I don't think the issue is being created on the Amplify side. I didn't see any issue on the Nx repo yet with a quick scan, but it looks like Nx users are complaining about something similar on the Expo repo in this issue expo/sentry-expo#363. @rudgal, thanks for providing a workaround! Looking forward to seeing if it resolves the issue for @david-gettins as well. |
This issue may be relevant as well: getsentry/sentry-react-native#3152 |
I can confirm that this worked for me. |
Worked, thanks! |
@gillicarmon, thank you for confirming! I'll close this issue down for now then seeing as the problem isn't on the Amplify side. |
Before opening, please confirm:
JavaScript Framework
React Native
Amplify APIs
Authentication
Amplify Categories
auth
Environment information
Describe the bug
After upgrading our NX project to NX 16 & React Native 0.72.3, I'm getting an error when importing Auth from amplify-aws
this is my import
At first, I couldn't import amplify as well (when we were on version
aws-amplify - 4.2.9
), After upgrading to the latestaws-amplify-5.3.8
, I'm able to import Storage & Amplify, but not Auth.After investigating, I found the issue is with
__extends(AuthClass, _super);
line 10 onnode_modules/@aws-amplify/auth/lib-esm/Auth.js
.If I'm comparing it to Storage.js which works, I can see their extends are implemented differently.
Expected behavior
Being able to import both Storage, Amplify and Auth.
Reproduction steps
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: