React Native - Unable to resolve “@aws-amplify/ui/dist/style.css”
See original GitHub issue** Which Category is your question related to? **
react-native
& @aws-amplify/ui
** What AWS Services are you utilizing? ** Amplify & Cognito
** Provide additional details e.g. code snippets **
I’m attempting to customize the AWS Amplify UI signin/signup process by following this article. Every time I import anything from aws-amplify-react I receive this error:
Unable to resolve "@aws-amplify/ui/dist/style.css" from "node_modules/aws-amplify-react/dist/Amplify-UI/Amplify-UI-Components-React.js"
I’ve tried installing @aws-amplify/ui
specifically, along with other combinations of aws-amplify versions. Here’s the relevant part of my package.json:
...
"aws-amplify": "^1.1.25",
"aws-amplify-react": "^2.3.5",
"aws-amplify-react-native": "^2.1.9",
...
And the versions of the specific UI & auth that I’ve tried:
"@aws-amplify/auth": "^1.2.21",
"@aws-amplify/ui": "^1.0.2",
Here is the import statement:
import { ConfirmSignIn, ConfirmSignUp, ForgotPassword, RequireNewPassword, SignIn, SignUp, VerifyContact, withAuthenticator } from 'aws-amplify-react';
Any help on resolving this issue is greatly appreciated.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
reactjs - Unable to resolve "@aws-amplify/ui/dist/style.css"
Unable to resolve "@aws-amplify/ui/dist/style.css" from "node_modules/aws-amplify-react/dist/Amplify-UI/Amplify-UI-Components-React.js".
Read more >AWS-Amplify/Lobby - Gitter
Unable to resolve module @aws-amplify/ui/dist/style.css from ... /node_modules/aws-amplify-react/dist/Amplify-UI/Amplify-UI-Components-React.js : Module ...
Read more >用户对问题“AWS Amplify & React Native -无法解析"@aws-amplify/ui ...
Unable to resolve "@aws-amplify/ui/dist/style.css" from "node_modules/aws-amplify-react/dist/Amplify-UI/Amplify-UI-Components-React.js"
Read more >aws-amplify: 用于使用云服务进行应用程序开发的声明性 ... - Gitee
If you can't migrate to aws-sdk-js-v3 or rely on aws-sdk@2.x, you will need to import it separately. ... import `@aws-amplify/ui/dist/style.css`; ...
Read more >Software development of explosion! -夢の破片(カケラ ...
React.js でサーバーサイドレンダリングするためのフレームワークです。 ... node_modules/@aws-amplify/ui/dist/style.css Global CSS cannot be ...
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
Hi @dperconti, thanks for using AWS Amplify!
It looks like you are using both
aws-amplify-react
andaws-amplify-react-native
. Theaws-amplify-react
module is not meant to be used with React Native. This is because CSS cannot be parsed in RN.Please follow this guide to pass a theme object to the authenticator component to customize styling.
To use this with Expo, which allows Web and Android/iOS builds, I installed
aws-amplify-react
andaws-amplify-react-native
and created two files:With this setup I just have to do
import ... from "./aws-amplify-react"
and get the right implementation.Now, I just have to hope they have the same interfaces, haha.