Closed laclance closed 2 years ago
Hi @laclance 👋 I don't see that you have a user pool defined in your aws-exports
file. I just copy/pasted the aws_exports config you shared and the error I'm seeing has to do with a missing user pool id.
Also, your graphql endpoint is not a url, but an ID for some reason.
This might be fixed if you were to run amplify pull
to overwrite and correct the aws-exports.js
file but I see that the error logs you shared show you got an error when trying to run the command. Are you still experiencing that issue with amplify pull
?
Can you check to make sure you have a schema.graphql
file in your amplify/backend/api/<apiName>/
directory?
If you do, can you share the schema?
Lastly, can you run amplify status
and share the output?
I think this issue was caused by the following change of PR #9628 https://github.com/aws-amplify/amplify-js/pull/9628/files#diff-d7133ba15216009e91d0c1632f34aa2279f4e6a03873e701c4abf582e011ed5fR1639
The comment above says "Purposely not calling the reject method here because we don't need a console error" yet the developer changed the line to call said reject method
I worked around the issue by pinning @aws-amplify/auth to 4.4.2, yet I hope to see that change reverted :D
@guillaumesmo did you have @aws-amplify/auth
installed separately alongside aws-amplify
? From your env info I could only see aws-amplify
was installed and so I was trying to reproduce with only that package.
You can reproduce it easily with the AWS Location Service Go to Maps, click on a map and go to the "Embed this map in your web application" tab https://eu-west-1.console.aws.amazon.com/location/maps/home?region=eu-west-1#/describe/explore.map/embed you'll need a Cognito identity pool ID and fill it in the placeholder
Replace the following 3 lines:
<script src="https://cdn.amplify.aws/packages/core/4.3.0/aws-amplify-core.min.js" integrity="sha384-7Oh+5w0l7XGyYvSqbKi2Q7SA5K640V5nyW2/LEbevDQEV1HMJqJLA1A00z2hu8fJ" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdn.amplify.aws/packages/auth/4.3.8/aws-amplify-auth.min.js" integrity="sha384-jfkXCEfYyVmDXYKlgWNwv54xRaZgk14m7sjeb2jLVBtUXCD2p+WU8YZ2mPZ9Xbdw" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdn.amplify.aws/packages/geo/1.1.0/aws-amplify-geo.min.js" integrity="sha384-TFMTyWuCbiptXTzvOgzJbV8TPUupG1rA1AVrznAhCSpXTIdGw82bGd8RTk5rr3nP" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
with the following:
<script src="https://cdn.jsdelivr.net/npm/@aws-amplify/core@4.4.1/dist/aws-amplify-core.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@aws-amplify/auth@4.4.3/dist/aws-amplify-auth.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@aws-amplify/geo@1.2.2/dist/aws-amplify-geo.min.js"></script>
error appears in the browser console, while the map works as expected
auth 4.4.2 works without error:
<script src="https://cdn.jsdelivr.net/npm/@aws-amplify/core@4.4.0/dist/aws-amplify-core.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@aws-amplify/auth@4.4.2/dist/aws-amplify-auth.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@aws-amplify/geo@1.2.1/dist/aws-amplify-geo.min.js"></script>
@guillaumesmo I'm able to reproduce the issue with these packages
<script src="https://cdn.jsdelivr.net/npm/@aws-amplify/core@4.4.1/dist/aws-amplify-core.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@aws-amplify/auth@4.4.3/dist/aws-amplify-auth.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@aws-amplify/geo@1.2.2/dist/aws-amplify-geo.min.js"></script>
but the scripts provided by the Amazon Location console seem to be compatible, I'm not able to reproduce the issue from copy/pasting the code snippet
In any case, if you run into errors or strange behavior like this, it is usually because of mismatching package versions in the dependency tree which cause multiple instances of Amplify to initialize.
For more information: https://docs.amplify.aws/lib/troubleshooting/upgrading/q/platform/js/
still get this error with any version above 4.3.15 but amplify and datastore still seem to work fine, although annoying to have a whole bunch of error lines in my console.
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 amplify-help
forum.
Before opening, please confirm:
JavaScript Framework
React
Amplify APIs
DataStore
Amplify Categories
auth, api
Environment information
Describe the bug
Been running datastore for almost 2 years and never had an auth issue until upgrading to aws-amplify v4.3.16 downgrading to 4.3.15 gets rid of the error
get this error twice when starting app
Also get this error when running amplify pull
Expected behavior
Amplify and datastore should run as normal
Reproduction steps
Create and amplify datastore project with lastest aws-amplify version add
Amplify.configure({ ...aws_exports, ssr: true });
in_app.tsx
runyarn && yarn dev
Code Snippet
Log output
aws-exports.js
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
Server console also prints
The schema has already been initialized
previously were mitigating this message by editing models/index.js