Search code examples
javascriptreactjsnext.jsnetlify

deploying nextjs site to netlify keep crashing


i'm trying to deploy my nextjs app netlify but it's keep throwing me failed error an not deploying here's my github repo https://github.com/naveenkash/Forex and here's the logs i tried fixing the swapicon but it still throws error before it was case sensitive error but it still giving me error now i fixed it

my deploy logs

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: > [email protected] 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! [email protected] 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 [email protected] 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

Solution

  • You haven't fixed the issue yet.

    Option 1

    Change

    import SwapIcon from "./swapicon";
    

    to

    import SwapIcon from "./swapIcon";
    

    OR

    Option 2

    Change the filename

    git mv ./swapIcon ./swapicon
    

    And then deploy.