javascript - 将 nextjs 站点部署到 netlify 不断崩溃
问题描述
我正在尝试部署我的 nextjs 应用程序 netlify,但它一直向我抛出失败错误,未部署这里是我的 github存储库https://github.com/naveenkash/Forex,这是我尝试修复 swapicon 但它之前仍然抛出错误的日志这是区分大小写的错误,但现在我修复了它仍然给我错误
我的部署日志
8:13:48 PM: Build ready to start
8:13:51 PM: build-image version: 9e0f207a27642d0115b1ca97cd5e8cebbe492f63
8:13:51 PM: build-image tag: v3.3.2
8:13:51 PM: buildbot version: 8727aab446158e7b8c8ad2e96fe74b0154505a4e
8:13:51 PM: Fetching cached dependencies
8:13:52 PM: Starting to download cache of 96.3MB
8:13:52 PM: Finished downloading cache in 925.950503ms
8:13:52 PM: Starting to extract cache
8:13:56 PM: Finished extracting cache in 3.93263713s
8:13:56 PM: Finished fetching cache in 4.897793706s
8:13:56 PM: Starting to prepare the repo for build
8:13:57 PM: Preparing Git Reference refs/heads/master
8:13:57 PM: Starting build script
8:13:57 PM: Installing dependencies
8:13:58 PM: Started restoring cached node version
8:14:00 PM: Finished restoring cached node version
8:14:01 PM: v10.16.3 is already installed.
8:14:02 PM: Now using node v10.16.3 (npm v6.9.0)
8:14:03 PM: Attempting ruby version 2.6.2, read from environment
8:14:05 PM: Using ruby version 2.6.2
8:14:05 PM: Using PHP version 5.6
8:14:05 PM: Started restoring cached node modules
8:14:05 PM: Finished restoring cached node modules
8:14:05 PM: Started restoring cached go cache
8:14:05 PM: Finished restoring cached go cache
8:14:06 PM: unset GOOS;
8:14:06 PM: unset GOARCH;
8:14:06 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.12.linux.amd64';
8:14:06 PM: export PATH="/opt/buildhome/.gimme/versions/go1.12.linux.amd64/bin:${PATH}";
8:14:06 PM: go version >&2;
8:14:06 PM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.12.linux.amd64.env';
8:14:06 PM: go version go1.12 linux/amd64
8:14:06 PM: Installing missing commands
8:14:06 PM: Verify run directory
8:14:06 PM: Executing user command: npm run deploy
8:14:06 PM: > transfer-to@0.1.0 deploy /opt/build/repo
8:14:06 PM: > next build && next export
8:14:08 PM: Attention: Next.js now collects completely anonymous telemetry regarding usage.
8:14:08 PM: This information is used to shape Next.js' roadmap and prioritize features.
8:14:08 PM: You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
8:14:08 PM: https://nextjs.org/telemetry
8:14:08 PM: Creating an optimized production build...
8:14:31 PM: Failed to compile.
8:14:31 PM: ./components/currencyInput.js
8:14:31 PM: Module not found: Can't resolve './swapicon' in '/opt/build/repo/components'
8:14:31 PM: > Build error occurred
8:14:31 PM: Error: > Build failed because of webpack errors
8:14:31 PM: at build (/opt/build/repo/node_modules/next/dist/build/index.js:7:847)
8:14:31 PM: npm ERR! code ELIFECYCLE
8:14:31 PM: npm ERR! errno 1
8:14:31 PM: npm ERR! transfer-to@0.1.0 deploy: `next build && next export`
8:14:31 PM: npm ERR! Exit status 1
8:14:31 PM: npm ERR!
8:14:31 PM: npm ERR! Failed at the transfer-to@0.1.0 deploy script.
8:14:31 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
8:14:31 PM: npm
8:14:31 PM: ERR! A complete log of this run can be found in:
8:14:31 PM: npm ERR!
8:14:31 PM: /opt/buildhome/.npm/_logs/2019-10-14T14_44_31_555Z-debug.log
8:14:31 PM: failed during stage 'building site': Build script returned non-zero exit code: 1
8:14:31 PM: Skipping functions preparation step: no functions directory set
8:14:31 PM: Caching artifacts
8:14:31 PM: Started saving node modules
8:14:31 PM: Shutting down logging, 14 messages pending
8:14:31 PM: Finished saving node modules
解决方案
你还没有解决问题。
选项1
改变
import SwapIcon from "./swapicon";
至
import SwapIcon from "./swapIcon";
或者
选项 2
更改文件名
git mv ./swapIcon ./swapicon
然后部署。
推荐阅读
- python - 使用 prometheus_client 向 Prometheus 公开包指标
- flutter - 应用程序从一天到另一天停止工作,没有任何变化
- d3.js - 如何在 D3 v5 中使用 identityTransform 实现 scaleBy?
- reactjs - React 组件在重新渲染时滚动回顶部
- python - 我正在尝试使用 wtforms 在烧瓶中创建下拉列表,但由于某种原因我的表单无法验证,有人可以告诉我为什么吗?
- css - 基本 CSS 问题 - 如何在 CSS 样式表中进行这项工作
- tfs - 用 $ 分配 TFS 变量
- qt - 如何优化大 QStringList 的代码?
- php - 将自定义字段添加到特定类别的 woocommerce 产品
- bootstrap-4 - 如何在引导列的右中对齐图像