-
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
Gen 2 - Amplify Outputs type issues after adding groups #14045
Comments
Hey @Drillan767, thank you for reaching out. Transferring the issue over to our Amplify Js repository for further investigation. |
Thanks for opening this issue. I was able to reproduce the same error thrown by Typescript. It looks like TS infers the type of the following JSON object differently than what the library expects: [
{
"ADMIN": {
"precedence": 0
}
},
{
"USER": {
"precedence": 1
}
}
]
// type =>
({
ADMIN: { precedence: number; };
USER?: undefined;
} | {
USER: { precedence: number; };
ADMIN?: undefined;
})[] |
Hi @Drillan767 sorry for the inconvenience, if you are testing only the Auth category features, could you temporarily test with this version |
Hello @HuiSF, no worries about the inconvenience, I'm just really glad you could reproduce it! I did downgrade to Do I keep this issue open? |
Thanks for confirming |
Hi @Drillan767, |
Hi again @ashwinkumar6, no typescript issue on my side with the unstable version, i managed to make a build! |
@Drillan767 |
Environment information
Describe the bug
Hello,
This is my first ever AWS project, so I'm not exactly certain this is a real issue, even though I can't find a solution to this problem.
I'm building a small website with both an admin and a user dashboard, so I decided to add groups. So I followed this documentation and added 2 groups, 'ADMIN' and 'USER' to my
amplify/auth/resource.ts
file like so:I also followed this documentation to automate the group adding on registration process. It works well, I just set 'USER' as the group a user will join.
But when trying to build the project, I got the following errors:
The relevant part of the auto generated
amplify_outputs
looks like so:Is there anything I didn't do correctly or at all? The auto generated output seems good to me.
Thank you in advance
Reproduction steps
"Simply" add the following to the
amplify/auth/resource.ts
file:And wait for the sandbox to regenerate.
The text was updated successfully, but these errors were encountered: