I’ve tried deploying this NextJS site multiple times, but it just freezes during deploy on Netlify. However, “npm run build” completes in seconds locally.
Latest build: Netlify App
Screenshot of build settings (overridden with netlify.toml):
netlify.toml
:
[Settings]
# Settings in the [build] context are global and are applied to all contexts
# unless otherwise overridden by more specific contexts.
[build]
# Directory to change to before starting a build.
# This is where we will look for package.json/.nvmrc/etc.
base = "spotlight"
# Directory (relative to root of your repo) that contains the deploy-ready
# HTML files and assets generated by the build.
publish = "build/"
# Default build command.
command = "npm run build"
# Directory with the lambda functions to deploy to AWS.
#functions = ".netlify/functions"
[[headers]]
# Define which paths this specific [[headers]] block will cover.
for = "/*"
[headers.values]
Access-Control-Allow-Origin = "*"
Access-Control-Allow-Methods = "POST, PUT, DELETE"
Access-Control-Allow-Headers = "Content-Type, Accept"
# Branch deploy context:
# All deploys that are not from a pull/merge request
# or from the production branch will inherit these settings.
#[context.branch-deploy]
# command = "make staging"
# Staging branch
[context.branch-deploy]
command = "npm run build:staging"
Full Log:
9:57:43 PM: build-image version: 4e021f34e58c8c6c6ee69b078ac3e861fee3ee31 (focal)
9:57:43 PM: buildbot version: 4e021f34e58c8c6c6ee69b078ac3e861fee3ee31
9:57:43 PM: Building without cache
9:57:43 PM: Starting to prepare the repo for build
9:57:44 PM: No cached dependencies found. Cloning fresh repo
9:57:44 PM: git clone --filter=blob:none https://github.com/josiahbryan/josiahbryan.com
9:57:44 PM: Preparing Git Reference refs/heads/master
9:57:50 PM: Parsing package.json dependencies
9:57:50 PM: Different build dir detected, going to use the one specified in the Netlify configuration file: 'spotlight' versus '' in the Netlify UI
9:57:50 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'spotlight/build' versus 'build/' in the Netlify UI
9:57:51 PM: Starting to install dependencies
9:57:51 PM: Python version set to 3.8
9:57:51 PM: Started restoring cached go cache
9:57:51 PM: Finished restoring cached go cache
9:57:51 PM: Installing Go version 1.19.5 (requested 1.19.5)
9:57:55 PM: go version go1.19.5 linux/amd64
9:57:56 PM: Using PHP version 8.0
9:57:56 PM: Downloading and installing node v14.4.0...
9:57:56 PM: Downloading https://nodejs.org/dist/v14.4.0/node-v14.4.0-linux-x64.tar.xz...
9:57:56 PM: Computing checksum with sha256sum
9:57:56 PM: Checksums matched!
9:57:58 PM: Now using node v14.4.0 (npm v6.14.5)
9:57:58 PM: Started restoring cached build plugins
9:57:58 PM: Finished restoring cached build plugins
9:57:58 PM: Started restoring cached corepack dependencies
9:57:58 PM: Finished restoring cached corepack dependencies
9:57:58 PM: No npm workspaces detected
9:57:58 PM: Started restoring cached node modules
9:57:58 PM: Finished restoring cached node modules
9:57:58 PM: Installing npm packages using npm version 6.14.5
9:58:13 PM: npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
9:58:13 PM: > core-js-pure@3.22.5 postinstall /opt/build/repo/spotlight/node_modules/core-js-pure
9:58:13 PM: > node -e "try{require('./postinstall')}catch(e){}"
9:58:14 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-android-arm-eabi@13.0.2 (node_modules/@next/swc-android-arm-eabi):
9:58:14 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-android-arm-eabi@13.0.2: wanted {"os":"android","arch":"arm"} (current: {"os":"linux","arch":"x64"})
9:58:14 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-android-arm64@13.0.2 (node_modules/@next/swc-android-arm64):
9:58:14 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-android-arm64@13.0.2: wanted {"os":"android","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
9:58:14 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-darwin-arm64@13.0.2 (node_modules/@next/swc-darwin-arm64):
9:58:14 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-darwin-arm64@13.0.2: wanted {"os":"darwin","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
9:58:14 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-darwin-x64@13.0.2 (node_modules/@next/swc-darwin-x64):
9:58:14 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-darwin-x64@13.0.2: wanted {"os":"darwin","arch":"x64"} (current: {"os":"linux","arch":"x64"})
9:58:14 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-freebsd-x64@13.0.2 (node_modules/@next/swc-freebsd-x64):
9:58:14 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-freebsd-x64@13.0.2: wanted {"os":"freebsd","arch":"x64"} (current: {"os":"linux","arch":"x64"})
9:58:14 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-linux-arm-gnueabihf@13.0.2 (node_modules/@next/swc-linux-arm-gnueabihf):
9:58:14 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-linux-arm-gnueabihf@13.0.2: wanted {"os":"linux","arch":"arm"} (current: {"os":"linux","arch":"x64"})
9:58:14 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-linux-arm64-gnu@13.0.2 (node_modules/@next/swc-linux-arm64-gnu):
9:58:14 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-linux-arm64-gnu@13.0.2: wanted {"os":"linux","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
9:58:14 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-linux-arm64-musl@13.0.2 (node_modules/@next/swc-linux-arm64-musl):
9:58:14 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-linux-arm64-musl@13.0.2: wanted {"os":"linux","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
9:58:14 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-win32-ia32-msvc@13.0.2 (node_modules/@next/swc-win32-ia32-msvc):
9:58:14 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-win32-ia32-msvc@13.0.2: wanted {"os":"win32","arch":"ia32"} (current: {"os":"linux","arch":"x64"})
9:58:14 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-win32-x64-msvc@13.0.2 (node_modules/@next/swc-win32-x64-msvc):
9:58:14 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-win32-x64-msvc@13.0.2: wanted {"os":"win32","arch":"x64"} (current: {"os":"linux","arch":"x64"})
9:58:14 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-win32-arm64-msvc@13.0.2 (node_modules/@next/swc-win32-arm64-msvc):
9:58:14 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-win32-arm64-msvc@13.0.2: wanted {"os":"win32","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
9:58:14 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents):
9:58:14 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
9:58:14 PM: added 717 packages from 365 contributors and audited 729 packages in 14.869s
9:58:14 PM: 225 packages are looking for funding
9:58:14 PM: run `npm fund` for details
9:58:14 PM: found 4 vulnerabilities (2 moderate, 2 high)
9:58:14 PM: run `npm audit fix` to fix them, or `npm audit` for details
9:58:14 PM: npm packages installed
9:58:14 PM: Attempting Ruby version 2.6.2, read from environment
9:58:15 PM: Required ruby-2.6.2 is not installed - installing.
9:58:15 PM: Searching for binary rubies, this might take some time.
9:58:15 PM: Found remote file https://rvm_io.global.ssl.fastly.net/binaries/ubuntu/20.04/x86_64/ruby-2.6.2.tar.bz2
9:58:15 PM: Checking requirements for ubuntu.
9:58:15 PM: Requirements installation successful.
9:58:15 PM: ruby-2.6.2 - #configure
9:58:15 PM: ruby-2.6.2 - #download
9:58:15 PM: ruby-2.6.2 - #validate archive
9:58:19 PM: ruby-2.6.2 - #extract
9:58:20 PM: ruby-2.6.2 - #validate binary
9:58:21 PM: ruby-2.6.2 - #setup
9:58:21 PM: ruby-2.6.2 - #gemset created /opt/buildhome/.rvm/gems/ruby-2.6.2@global
9:58:21 PM: ruby-2.6.2 - #importing gemset /opt/buildhome/.rvm/gemsets/global.gems........................................
9:58:22 PM: ruby-2.6.2 - #generating global wrappers........
9:58:22 PM: ruby-2.6.2 - #gemset created /opt/buildhome/.rvm/gems/ruby-2.6.2
9:58:22 PM: ruby-2.6.2 - #importing gemsetfile /opt/buildhome/.rvm/gemsets/default.gems evaluated to empty gem list
9:58:22 PM: ruby-2.6.2 - #generating default wrappers........
9:58:22 PM: Using /opt/buildhome/.rvm/gems/ruby-2.6.2
9:58:23 PM: Using Ruby version 2.6.2
9:58:23 PM: Install dependencies script success
9:58:23 PM: Starting build script
9:58:23 PM: Using stage install dependencies
9:58:24 PM: Detected 1 framework(s)
9:58:24 PM: "next" at version "13.0.2"
9:58:24 PM: Section completed: initializing
9:58:25 PM:
9:58:25 PM: Netlify Build
9:58:25 PM: ────────────────────────────────────────────────────────────────
9:58:25 PM:
9:58:25 PM: ❯ Version
9:58:25 PM: @netlify/build 29.8.0
9:58:25 PM:
9:58:25 PM: ❯ Flags
9:58:25 PM: baseRelDir: true
9:58:25 PM: buildId: 6424faa456a66d0592bf56ca
9:58:25 PM: deployId: 6424faa456a66d0592bf56cc
9:58:25 PM:
9:58:25 PM: ❯ Current directory
9:58:25 PM: /opt/build/repo/spotlight
9:58:25 PM:
9:58:25 PM: ❯ Config file
9:58:25 PM: /opt/build/repo/netlify.toml
9:58:25 PM:
9:58:25 PM: ❯ Context
9:58:25 PM: production
9:58:25 PM:
9:58:25 PM: 1. build.command from netlify.toml
9:58:25 PM: ────────────────────────────────────────────────────────────────
9:58:25 PM:
9:58:25 PM: $ npm run build
9:58:25 PM: > tailwindui-template@0.1.0 build /opt/build/repo/spotlight
9:58:25 PM: > next build
9:58:26 PM: warn - You have enabled experimental feature (scrollRestoration) in next.config.mjs.
9:58:26 PM: warn - Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use at your own risk.
9:58:26 PM: warn - No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
9:58:26 PM: Browserslist: caniuse-lite is outdated. Please run:
9:58:26 PM: npx browserslist@latest --update-db
9:58:26 PM: Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
9:58:26 PM: info - Linting and checking validity of types...
9:58:28 PM: Browserslist: caniuse-lite is outdated. Please run:
9:58:28 PM: npx browserslist@latest --update-db
9:58:28 PM: Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
9:58:28 PM: info - Creating an optimized production build...
9:58:29 PM: Browserslist: caniuse-lite is outdated. Please run:
9:58:29 PM: npx browserslist@latest --update-db
9:58:29 PM: Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating