gpt4 book ai didi

reactjs - 为什么我在 "Cannot find file ' 中收到此错误 : './src' ./App'。":?

转载 作者:行者123 更新时间:2023-12-04 09:21:11 25 4
gpt4 key购买 nike

我正在尝试将我的 React 应用程序部署到 aws-amplify,但我在 aws 的构建过程中不断收到此错误。

当我在生产环境中运行应用程序时,“yarn run build”它在本地运行良好,但是当我将更改推送到 aws 时,出现以下错误:

"Failed to compile.
2020-07-26T15:51:52.356Z [INFO]: ./src/index.js
Cannot find file './App' in './src'.":

more detailed aws error image attached

我的文件夹结构如下:

- public
- favicon.ico
- index.html
- logo192.png
- logo512.png
- manifest.json
- robots.txt
- src
- assets
- components
- Contact.js
- Home.js
- Navigation.js
- NotFound.js
- Project.js
- Projects.js
- App.css
- App.js
- App.test.js
- contact.css
- home.css
- index.css
- index.js
- logo.svg
- projects.css
- serviceWorker.js
- setupTest.js
- .gitignore
- package.json
- README.md
- yarn.lock

app component

screenshot of my index.js and the folder structure

最佳答案

您包含文件 App.css 但只有 app.css。修正第一个字母的大小写。

一些操作系统(或者更确切地说,一些文件系统)是区分大小写的。您必须正确填写文件名。

如果您使用的是版本控制系统(例如 git),请确保您已在版本控制系统中重命名该文件。在不区分大小写的文件系统上,不会检测到大小写更改。

关于reactjs - 为什么我在 "Cannot find file ' 中收到此错误 : './src' ./App'。":?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63102949/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com