CSS stylesheets missing when using withAuthenticator from the aws-amplify-react package version 4.1.7
See original GitHub issueDescribe the bug
CSS stylesheets missing when using withAuthenticator
from the aws-amplify-react
package version 4.1.7
To Reproduce Steps to reproduce the behavior:
npx create-react-app my-app && cd my-app
npm i aws-amplify aws-amplify-reac@4.1.7
- Configure:
import { withAuthenticator } from 'aws-amplify-react';
import Amplify, { Auth } from 'aws-amplify';
import awsconfig from './aws-exports';
Amplify.configure(awsconfig);
- Wrap React
App
component withwithAuthenticator
export default withAuthenticator(App);
npm run start
- Open
http://localhost:3000/
Expected behavior Full blown AWS login UI appears.
Instead just pure HTML appears.
Screenshots Expected:
Actual:
Environment
$ npx envinfo --system --binaries --browsers --npmPackages --npmGlobalPackages
npx: installed 1 in 0.925s
System:
OS: macOS 10.15.3
CPU: (8) x64 Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
Memory: 1.13 GB / 64.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.16.2 - /opt/local/bin/node
npm: 6.14.4 - /opt/local/bin/npm
Browsers:
Brave Browser: 80.1.5.112
Chrome: 81.0.4044.113
Firefox: 74.0.1
Safari: 13.0.5
npmPackages:
@testing-library/jest-dom: ^5.5.0 => 5.5.0
@testing-library/react: ^10.0.2 => 10.0.2
@testing-library/user-event: ^10.0.2 => 10.0.2
aws-amplify: ^3.0.8 => 3.0.8
aws-amplify-react: ^4.1.7 => 4.1.7
react: ^16.13.1 => 16.13.1
react-dom: ^16.13.1 => 16.13.1
react-scripts: 3.4.1 => 3.4.1
npmGlobalPackages:
aws-cdk: 1.31.0
gatsby-cli: 2.11.4
generator-cosappsync: 0.9.0
npm-check-updates: 4.1.2
npm: 6.14.4
surge: 0.21.3
yo: 3.1.1
Additional context Not sure with what specific version did this issue appear the first time.
When I install aws-amplify-react
version 3.1.9
in the same project, the UI appears as expected.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:15
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Login form implemented with Amplify is not applied styling
This question is about AWS Amplify. I am trying to implement login form with React and withAuthenticator() of Amplify in reference to a...
Read more >Authenticator - React Native - AWS Amplify Docs
A simple way to add authentication flows into your app is to use the Authenticator component. The Authenticator component encapsulates an authentication ...
Read more >Amplify UI's new Authenticator component makes it easy to ...
In this blog post we will deploy a React app with Amplify Hosting, set up auth, and then integrate the <Authenticator> UI component...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@matyashlavacek As of aws-amplify-react@4.x.x, the Authenticator is not styled. To include default styling in JavaScript, add this line before Amplify.configure:
Are you doing this? Its probably what you are missing
Its in the docs https://aws-amplify.github.io/docs/js/react#add-auth under auth for react.
Ah I see, I was using
aws-amplify-react@3.x.x
before, which had the CSS included. I found out about thewithAuthenticator HOC
in the same place in the docs as @rrrix did. It would be nice to include it into these docs too indeed. Thanks for the info! @ashika01