Skip to content
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

[Feedback]Getting Started Amplify should include Import info #3949

Closed
AlphaJuliettOmega opened this issue Jan 19, 2022 · 5 comments
Closed
Assignees
Labels
amplify/js Issues tied to JS details-needed-from-requester More information is required to determine next actions. p3 missing info

Comments

@AlphaJuliettOmega
Copy link

Page: /lib/q/platform/[platform]

Feedback:

Imports were recently split.

  1. Are there repercussions if you use the non-split Amplify with parts that are Split
  2. Which is better practice?
  3. How to import correctly should be the first thing
  4. the first result if you search up top when typing 'import', should be on importing the library instead of Amplify Studio stuff
@AlphaJuliettOmega
Copy link
Author

Ok, I found out what my issue was.

Please do not close this ticket until you document this or improve documentation on this.
It's related to there being 0 documentation on the modular split

This works:

import Amplify from '@aws-amplify/core'
Amplify.configure(config)

Until you try to use a subscription from a GraphQL endpoint.
I removed these three packages:

    "@aws-amplify/auth": "^4.3.15",
    "@aws-amplify/core": "^4.3.7",
    "@aws-amplify/storage": "^4.4.8",

and now only import like this:

    "aws-amplify": "^4.2.4",

And subscriptions to my appsync graphql endpoint works flawlessly.

There are hundreds of threads probably caused by this.

I also got:

"Subscribe only available for AWS AppSync endpoint"

as well as:

AppSync Realtime subscription init error: Error: No credentials

as well as No Current User as specified in this issue

With Amplify.Loglevel set to debug I got:

Error: No credentials at GraphQLAPIClass.eval

Trying different ways of modifying the call/config all resulted in errors that aren't useful and hours could have been prevented with a:

Warning: You have multiple AWS Auth packages imported, use one

or any kind of documentation whatsoever including the imports, the docs I could find all show the code with imports omitted.

@siegerts siegerts added the amplify/js Issues tied to JS label Jan 19, 2022
@AlphaJuliettOmega
Copy link
Author

Same symptoms for examples:
aws-amplify/amplify-js#5814
aws-amplify/amplify-cli#4141
aws-amplify/amplify-js#1252
#2177

Another person who had the same issue:
aws-amplify/amplify-js#8888 (comment)

Example of recommendation that causes bug:
aws-amplify/amplify-js#488 (comment)

Modularisation that caused this small documentation gap:
aws-amplify/amplify-js#3365

I just felt compelled to round this off with this comment.

@ashika01
Copy link
Contributor

@AlphaJuliettOmega thank you for detailed issue here. We do have what configuration goes into each category in the library like this,
Screen Shot 2022-01-28 at 1 01 38 PM

Would you like for us to have a separate single page on configuration talking about various ways of configuration and also add note on cleaning up node_modules and other artifacts everytime they add/remove package?

@ashika01 ashika01 self-assigned this Jan 28, 2022
@siegerts siegerts added the details-needed-from-requester More information is required to determine next actions. label Mar 29, 2022
@siegerts
Copy link
Contributor

@AlphaJuliettOmega, just following up on the comments above. Any thoughts on this?

@mauerbac mauerbac added the p3 missing info label May 8, 2022
@siegerts
Copy link
Contributor

siegerts commented Aug 9, 2022

Closing for now. Can reopen if there is more information or follow up.

@siegerts siegerts closed this as completed Aug 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
amplify/js Issues tied to JS details-needed-from-requester More information is required to determine next actions. p3 missing info
Projects
None yet
Development

No branches or pull requests

4 participants