-
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
SignIn call gave error - AuthUserPoolException: Auth UserPool not configured. #13135
Comments
HI @aoneahsan thank you for openning this issue. Could you clarify why you are installing both "aws-amplify" and "@aws-amplify/core" + "@aws-amplify/auth" packages? You should only need to install |
basically i wanted to use @aws-amplify/core + @aws-amplify/auth that did not work that's why i had to use this aws-amplify |
@aoneahsan got it. The recommended usage is to import the api's from Did you have concerns with this? Im looking to understand why you are wanting to use |
yes, i want to use these packages so it will improve the final bundle size |
@aoneahsan bundle size should not be a problem because the library supports tree shaking capabilities, if you are using a modern bundler (like webpack) it should only include the part of the library you are importing. |
okay, but let's focus on why it's giving error when tried with @aws-amplify/auth package? |
You are importing modules from different packages, which may lead to receive different instances of the Amplify object, which may not be fully configured. In particular, if you call the |
@aoneahsan, have you had a chance to review the above comments? Just want to check in and see if there are still any concerns at this point. Thanks. |
I'm using "aws-amplify" package right now and it's working. but i want to know how to use "@aws-amplify" packages properly please do share any official resource example showing the process |
@aoneahsan, we don't have any resources to share on this because we don't recommend this (as @HuiSF mentioned above). However, this would be the list of categories within Amplify that would utilize the
|
Ran into this same issue during migration from v5 to v6 and I guess my use case is similar to that of @aoneahsan. i.e. Using a pre-existing AWS Cognito instance for auth with the least amount of configuration and reliance on Amplify. I can confirm that using only the
with
worked exactly as described above (i.e. avoiding partially configured providers) and did not significantly affect the bundle size, even with development generated bundles. |
It looks like we can call this issue resolved then at this point. If anyone following this still has questions or experiencing a further blocker tied to this, feel free to reply back and we can reopen. |
I have same problem if use import { fetchAuthSession } from '@aws-amplify/auth';
import { Amplify, ResourcesConfig } from '@aws-amplify/core'; If only use import { fetchAuthSession } from 'aws-amplify/auth';
import { Amplify, ResourcesConfig } from 'aws-amplify';
import awsconfig from '@/aws-exports';
const libraryOptions = {
API: {
GraphQL: {
headers: async () => ({
Authorization: (await fetchAuthSession()).tokens?.idToken?.toString() as string,
}),
},
},
};
Amplify.configure(awsconfig, libraryOptions); @ShadowOfLies thanks for your confirm. |
Before opening, please confirm:
JavaScript Framework
React
Amplify APIs
Authentication
Amplify Version
v6
Amplify Categories
No response
Backend
None
Environment information
Describe the bug
using @aws-amplify package in reactjs app
tried signUp, confirmSignUp both function calls works fine
when trying to hit "signIn" function it's giving this error
index.test-page.tsx:170 AWSAmplifyTestPage -> signInHandler -> error signing in: AuthUserPoolException: Auth UserPool not configured.
at http://localhost:5173/node_modules/.vite/deps/chunk-RH7ZAJRH.js?v=39db8c3f:203:11
at assertTokenProviderConfig (http://localhost:5173/node_modules/.vite/deps/chunk-RH7ZAJRH.js?v=39db8c3f:406:3)
at DefaultTokenStore.getAuthKeys (http://localhost:5173/node_modules/.vite/deps/@aws-amplify_auth.js?v=39db8c3f:5071:5)
at DefaultTokenStore.getDeviceMetadata (http://localhost:5173/node_modules/.vite/deps/@aws-amplify_auth.js?v=39db8c3f:5051:33)
at TokenOrchestrator.getDeviceMetadata (http://localhost:5173/node_modules/.vite/deps/@aws-amplify_auth.js?v=39db8c3f:5205:33)
at handlePasswordVerifierChallenge (http://localhost:5173/node_modules/.vite/deps/@aws-amplify_auth.js?v=39db8c3f:4588:51)
at async retryOnResourceNotFoundException (http://localhost:5173/node_modules/.vite/deps/@aws-amplify_auth.js?v=39db8c3f:4871:12)
at async signInWithSRP (http://localhost:5173/node_modules/.vite/deps/@aws-amplify_auth.js?v=39db8c3f:5416:133)
at async signInHandler (http://localhost:5173/src/testPages/aws-amplify/index.test-page.tsx?t=1710676813673:154:25)
Expected behavior
should work, as it worked with "aws-amplify/auth".
same code in "aws-amplify/auth" works, while that same code when I use "@aws-amplify/auth" package gives error.
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
using @aws-amplify package in reactjs app
tried signUp, confirmSignUp both function calls works fine
when trying to hit "signIn" function it's giving this error
index.test-page.tsx:170 AWSAmplifyTestPage -> signInHandler -> error signing in: AuthUserPoolException: Auth UserPool not configured.
at http://localhost:5173/node_modules/.vite/deps/chunk-RH7ZAJRH.js?v=39db8c3f:203:11
at assertTokenProviderConfig (http://localhost:5173/node_modules/.vite/deps/chunk-RH7ZAJRH.js?v=39db8c3f:406:3)
at DefaultTokenStore.getAuthKeys (http://localhost:5173/node_modules/.vite/deps/@aws-amplify_auth.js?v=39db8c3f:5071:5)
at DefaultTokenStore.getDeviceMetadata (http://localhost:5173/node_modules/.vite/deps/@aws-amplify_auth.js?v=39db8c3f:5051:33)
at TokenOrchestrator.getDeviceMetadata (http://localhost:5173/node_modules/.vite/deps/@aws-amplify_auth.js?v=39db8c3f:5205:33)
at handlePasswordVerifierChallenge (http://localhost:5173/node_modules/.vite/deps/@aws-amplify_auth.js?v=39db8c3f:4588:51)
at async retryOnResourceNotFoundException (http://localhost:5173/node_modules/.vite/deps/@aws-amplify_auth.js?v=39db8c3f:4871:12)
at async signInWithSRP (http://localhost:5173/node_modules/.vite/deps/@aws-amplify_auth.js?v=39db8c3f:5416:133)
at async signInHandler (http://localhost:5173/src/testPages/aws-amplify/index.test-page.tsx?t=1710676813673:154:25)
The text was updated successfully, but these errors were encountered: