-
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
API and Storage modules not registered when calling Amplify.configure
#3505
Comments
@christiankaindl, I just had the same problem. So, instead of:
I did following:
Not sure if this is the best way of resolving it, but it did help in my case. |
Thanks for your help @Magneticoz , really appreachiate it. If I take your approach, then all modules seem to get configured but I get a 403 with response message "Missing Authentication Token" when calling Note: When calling Also note the |
@christiankaindl, can you share your code for it? Both the configuration setup and the import to the certain component? Because I have the same setup ( on Angular ) and it's working ( Auth, API & Storage ). |
@christiankaindl , I was having the same issue (on React). So tried deleting node_modules and did npm install and the problem was solved. |
Thanks for the help everyone! I got it working, here is a short summary: The API.post('main', '/getPosts'); // wrong
API.post('main', 'getPosts'); // Correct The Auth problem was fixed by updating all packages again and deleting + reinstalling node_modules. Also tested to use the Amplify.configure({
Auth: {
region: REGION,
userPoolId: USER_POOL,
identityPoolId: IDENTITY_POOL,
userPoolWebClientId: USER_POOL_CLIENT
},
API: {
endpoints: [
{
region: REGION,
name: 'main',
endpoint: API_ENDPOINT
}
]
},
Storage: {
AWSS3: {
region: REGION,
bucket: S3_BUCKET
}
}
}) I updated the packages a week ago, and now again two days ago. Otherwise I have no idea what else fixed it ¯_(ツ)_/¯ Many thanks for your help @Magneticoz and @ssk690 <3 |
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs. Looking for a help forum? We recommend joining the Amplify Community Discord server |
Describe the bug
When using Amplify, I am unable to use Storage and API methods, and get respective errors (errors are below).
I am importing Amplify core package (@aws-amplify/core) and call the configure method like the following (code that is actually used):
Expected behavior
The Storage and API modules should work as documented.
Desktop (please complete the following information):
Package.json dependencies:
Additional context
React app, bundler is Parcel.
Log output: (the lines with
Logging ...
are from my code and log the Amplify object)After that when my app imports the API module (@aws-amplify/api), using the
post
method, I get anAPI not configured
error.When importing and calling
Storage.put
, the error becomes:I suspect the API and Storage modules aren't registered, because they still give
null
when logged (the "BEFORE" and "AFTER" logs in the screenshot above). I reinstalled the node_modules multiple times already to have a clean install.The text was updated successfully, but these errors were encountered: