我在部署netlify时遇到了一些问题。这些是我收到的错误:
Error: ./src/pages/index.js
12:55:30 PM: Module not found: Error: Can't resolve '../components/Featured' in '/opt/build /repo/src/pages'
12:55:30 PM: resolve '../components/Featured' in '/opt/build/repo/src/pages'
12:55:30 PM: using description file: /opt/build/repo/package.json (relative path: ./src/p ages)
12:55:30 PM: Field 'browser' doesn't contain a valid alias configuration
由于某种原因,它找不到组件。在当地建设很好。
我使用了带样式组件的gatsby-starter。
我尝试过的事情: 关于窗口的未定义,我有一些本地建筑错误。我通过有条件地将它们包括为the manual proposes来解决了这些问题。应用此选项后,我开始从“工作箱”接收控制台日志。
(顺便说一句,这是我第一次尝试部署netlify)
错误Field 'browser' doesn't contain a valid alias configuration
还在日志中不断重复
here's a link to the full log我来自netlify
答案 0 :(得分:3)
错误是由于webpack无法解析您的相对路径所致。确保使用正确的大小写。
import Hero from '../components/hero'
import Introduce from '../components/introduce'
import HelpMeHelpYou from '../components/helpmehelpyou'
import Featured from '../components/featured'
import Testimonials from '../components/testimonials'
import Projects from '../components/projects'
import Gallery from '../components/gallery'
import Outroduce from '../components/outroduce'
答案 1 :(得分:0)
运行下面的命令,然后将代码推送到 Github 存储库。
git config core.ignorecase false