
表題のとおりなのですが、以下のpackage.jsonの各バージョンにおいて、Amplifyでビルドすると該当のエラーが発生します。
もし何か手がかりだけでもご教示いただけるようでしたらお願いできると幸いです。
エラー
2022-04-10T08:08:38.593Z [INFO]: Failed to compile. 2022-04-10T08:08:38.594Z [INFO]: ./src/NotLoggedin.jsx Cannot find module: '@aws-amplify/ui-react/styles.css'. Make sure this package is installed. You can install this package by running: npm install @aws-amplify/ui-react/styles.css. 2022-04-10T08:08:38.608Z [ERROR]: !!! Build failed 2022-04-10T08:08:38.608Z [ERROR]: !!! Non-Zero Exit Code detected 2022-04-10T08:08:38.609Z [INFO]: # Starting environment caching... 2022-04-10T08:08:38.610Z [INFO]: # Uploading environment cache artifact... 2022-04-10T08:08:38.722Z [INFO]: # Environment caching completed
package.json
"dependencies": { "@aws-amplify/ui-react": "^2.15.1", "@barusu-react/icons": "", "@chakra-ui/icons": "", "@chakra-ui/react": "", "@emotion/react": "", "@emotion/styled": "", "@reduxjs/toolkit": "", "aws-amplify": "^4.3.19", "axios": "", "create-chakra-icons": "", "framer-motion": "", "react": "17.0.2", "react-dom": "17.0.2", "react-icons": "", "react-redux": "", "react-router-dom": "6.2.1", "react-scripts": "", "react-simple-star-rating": "", "typescript": "^4.6.3" }
package-lock.json
"dependencies": { "@aws-amplify/ui-react": "^2.15.1", "@barusu-react/icons": "", "@chakra-ui/icons": "", "@chakra-ui/react": "", "@emotion/react": "", "@emotion/styled": "", "@reduxjs/toolkit": "", "aws-amplify": "^4.3.19", "axios": "", "create-chakra-icons": "", "framer-motion": "", "react": "17.0.2", "react-dom": "17.0.2", "react-icons": "", "react-redux": "", "react-router-dom": "6.2.1", "react-scripts": "", "react-simple-star-rating": "", "typescript": "^4.6.3" },
やったこと
- package-lock.jsonとnode_modulesを消して npm install
- @aws-amplify/ui-react のバージョンを同じ2系のなかでダウングレードしてみた

ちなみに、ローカルでnpm startして動かした際には該当のライブラリは2系で正常に動作しているように見えます(2系のソーシャルログインに係るコードが正常に動作していること、2系でExportされているAuthenticatorなどが使えていることなどから。CSSも正常にスタイリングされているため、読み込めているようです。)。

回答1件
あなたの回答
tips
プレビュー