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

@aws-amplify/ui-react@3.4.0 Authenticator component does not work with Gatsby 4.23.0 #2598

Closed
4 tasks done
kota65535 opened this issue Sep 16, 2022 · 1 comment
Closed
4 tasks done
Assignees
Labels
Authenticator An issue or a feature-request for an Authenticator UI Component bug Something isn't working

Comments

@kota65535
Copy link

Before creating a new issue, please confirm:

On which framework/platform are you having an issue?

React

Which UI component?

Authenticator

How is your app built?

Gatsby 4.23.0

What browsers are you seeing the problem on?

Chrome

Please describe your bug.

This issue is maybe similar to #1226.

With the latest Gatsby 4.23.0, upgrading from @aws-amplify/ui-react 3.3.0 to 3.4.0 breaks UI interaction of Authenticator component.
I've confirmed the following buttons are not working (nothing happens).

  • Sign in button
  • Create Account button

What's the expected behaviour?

  • Sign in button should let the user sign in
  • Create Account button should let the user create account

Help us reproduce the bug!

  1. Clone gatsby-starter-default
  2. Rewrite index.js to use Authenticator according to this tutorial
  3. Run gatsby develop to start server
  4. Access to localhost:8000 and then click Sign in button

image

Code Snippet

index.js is as follows.

// Put your code below this line.

import * as React from "react"
import awsExports from './aws-exports.json';
import {Amplify} from "aws-amplify";
import {Authenticator} from "@aws-amplify/ui-react";
import '@aws-amplify/ui-react/styles.css';

Amplify.configure(awsExports);

export default function App() {
  return (
    <Authenticator>
      {({signOut, user}) => (
        <main>
          <h1>Hello {user.username}</h1>
          <button onClick={signOut}>Sign out</button>
        </main>
      )}
    </Authenticator>
  );
}

Additional information and screenshots

No response

@slaymance
Copy link
Contributor

I was able to trace this issue to the 3.13.0 release of the @aws-amplify/ui package (a dependency of @aws-amplify/ui-react). @aws-amplify/ui-react@3.4.0 uses the version of the package that bumps the xstate dependency to ^4.33.0 (#2432).

While we work on a fix to this issue, you can workaround the error by overriding the xstate dependency version used by your application.

Using npm (>= v8)

Add the following block to your project's package.json:

"overrides": {
  "xstate": "4.33"
}

Using yarn

Add the following block to your project's package.json:

"resolutions": {
  "xstate": "4.33"
}

@slaymance slaymance added Authenticator An issue or a feature-request for an Authenticator UI Component and removed pending-triage Issue is pending triage investigating This issue is being investigated labels Sep 16, 2022
@Milan-Shah Milan-Shah added the bug Something isn't working label Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Authenticator An issue or a feature-request for an Authenticator UI Component bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants