Hi!
I’m using NextJS 13 with app directory and have a project that works absolutely fine in dev, whether I do yarn dev, or yarn build and yarn start. However, the deployed website gives a 500 error for every page. I suspect the request is timing out- something funny is happening on the server and I’m at a complete loss as to what.
What’s strange is that my api endpoints work just fine. Another striking observation is the following line from the deploy log:
1:26:27 AM: ┌ ○ / 0 B 0 B
It’s unclear to me why the size of the SSR page is 0 bytes altogether. I’m not sure if that’s related.
Any assistance would be greatly appreciated here!
// details below
Site name: https://four-eight.netlify.app/
Build log:
1:25:38 AM: build-image version: d7b3813f01c06610bc1723ff1b22446513ee7941 (focal)
1:25:38 AM: build-image tag: v4.14.3
1:25:38 AM: buildbot version: be0925a1b4e8f8d2c5a767f3e0decf8856cad273
1:25:39 AM: Fetching cached dependencies
1:25:39 AM: Starting to download cache of 1.3GB
1:25:49 AM: Finished downloading cache in 10.260875274s
1:25:49 AM: Starting to extract cache
1:25:56 AM: Finished extracting cache in 7.173038799s
1:25:56 AM: Finished fetching cache in 17.580328547s
1:25:56 AM: Starting to prepare the repo for build
1:25:56 AM: Preparing Git Reference refs/heads/main
1:25:57 AM: Parsing package.json dependencies
1:25:58 AM: Starting build script
1:25:58 AM: Installing dependencies
1:25:58 AM: Python version set to 2.7
1:25:59 AM: Started restoring cached node version
1:25:59 AM: Finished restoring cached node version
1:26:00 AM: v16.18.1 is already installed.
1:26:00 AM: Now using node v16.18.1 (npm v8.19.2)
1:26:00 AM: Enabling node corepack
1:26:00 AM: Started restoring cached build plugins
1:26:00 AM: Finished restoring cached build plugins
1:26:00 AM: Attempting ruby version 2.7.2, read from environment
1:26:01 AM: Using ruby version 2.7.2
1:26:01 AM: Using PHP version 8.0
1:26:01 AM: Started restoring cached yarn cache
1:26:06 AM: Finished restoring cached yarn cache
1:26:07 AM: No yarn workspaces detected
1:26:07 AM: Started restoring cached node modules
1:26:07 AM: Finished restoring cached node modules
1:26:07 AM: Installing NPM modules using Yarn version 1.22.19
1:26:07 AM: yarn install v1.22.19
1:26:07 AM: [1/4] Resolving packages…
1:26:07 AM: success Already up-to-date.
1:26:07 AM: Done in 0.14s.
1:26:07 AM: NPM modules installed using Yarn
1:26:07 AM: Started restoring cached go cache
1:26:07 AM: Finished restoring cached go cache
1:26:07 AM: Installing Go version 1.17 (requested 1.17)
1:26:12 AM: unset GOOS;
1:26:12 AM: unset GOARCH;
1:26:12 AM: export GOROOT=‘/opt/buildhome/.gimme/versions/go1.17.linux.amd64’;
1:26:12 AM: export PATH=“/opt/buildhome/.gimme/versions/go1.17.linux.amd64/bin:${PATH}”;
1:26:12 AM: go version >&2;
1:26:12 AM: export GIMME_ENV=“/opt/buildhome/.gimme/env/go1.17.linux.amd64.env”
1:26:12 AM: go version go1.17 linux/amd64
1:26:12 AM: Detected 1 framework(s)
1:26:12 AM: “next” at version “13.0.2”
1:26:12 AM: Installing missing commands
1:26:12 AM: Verify run directory
1:26:14 AM:
1:26:14 AM: ────────────────────────────────────────────────────────────────
1:26:14 AM: Netlify Build
1:26:14 AM: ────────────────────────────────────────────────────────────────
1:26:14 AM:
1:26:14 AM: ❯ Version
1:26:14 AM: @netlify/build 28.1.13
1:26:14 AM:
1:26:14 AM: ❯ Flags
1:26:14 AM: baseRelDir: true
1:26:14 AM: buildId: 636ef611266ea3000849fcfc
1:26:14 AM: deployId: 636ef611266ea3000849fcfe
1:26:14 AM:
1:26:14 AM: ❯ Current directory
1:26:14 AM: /opt/build/repo
1:26:14 AM:
1:26:14 AM: ❯ Config file
1:26:14 AM: No config file was defined: using default values.
1:26:14 AM:
1:26:14 AM: ❯ Context
1:26:14 AM: production
1:26:14 AM:
1:26:14 AM: ❯ Using Next.js Runtime - v4.28.6
1:26:15 AM:
1:26:15 AM: ────────────────────────────────────────────────────────────────
1:26:15 AM: 1. @netlify/plugin-nextjs (onPreBuild event)
1:26:15 AM: ────────────────────────────────────────────────────────────────
1:26:15 AM:
1:26:15 AM: Next.js cache restored.
1:26:15 AM: Netlify configuration property “build.environment.NEXT_PRIVATE_TARGET” value changed.
1:26:15 AM:
1:26:15 AM: (@netlify/plugin-nextjs onPreBuild completed in 73ms)
1:26:15 AM:
1:26:15 AM: ────────────────────────────────────────────────────────────────
1:26:15 AM: 2. Build command from Netlify app
1:26:15 AM: ────────────────────────────────────────────────────────────────
1:26:15 AM:
1:26:15 AM: $ yarn build
1:26:15 AM: yarn run v1.22.19
1:26:15 AM: $ next build
1:26:16 AM: info - Loaded env from /opt/build/repo/.env
1:26:16 AM: warn - You have enabled experimental feature (appDir) in next.config.js.
1:26:16 AM: warn - Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use at your own risk.
1:26:16 AM: info - Thank you for testing appDir
please leave your feedback at https://nextjs.link/app-feedback
1:26:16 AM: info - Creating an optimized production build…
1:26:18 AM: info - Compiled successfully
1:26:18 AM: info - Linting and checking validity of types…
1:26:21 AM: info - VS Code settings.json has been created for Next.js’ automatic app types, this file can be added to .gitignore if desiredinfo - Collecting page data…
1:26:22 AM: info - Generating static pages (0/5)
1:26:23 AM: info - Generating static pages (1/5)
1:26:23 AM: info - Generating static pages (2/5)
1:26:23 AM: info - Generating static pages (3/5)
1:26:26 AM: info - Generating static pages (5/5)
1:26:27 AM: info - Finalizing page optimization…
1:26:27 AM: Route (app) Size First Load JS
1:26:27 AM: ┌ ○ / 0 B 0 B
1:26:27 AM: ├ ○ /about 135 B 65.6 kB
1:26:27 AM: ├ ○ /music 136 B 65.6 kB
1:26:27 AM: └ λ /post/[id] 137 B 65.6 kB
1:26:27 AM: + First Load JS shared by all 65.5 kB
1:26:27 AM: ├ chunks/17-65d9a22e9d3b2cd2.js 63 kB
1:26:27 AM: ├ chunks/main-app-5dbe79f35bd947e6.js 200 B
1:26:27 AM: └ chunks/webpack-47a49d2fdd84dda0.js 2.27 kB
1:26:27 AM: Route (pages) Size First Load JS
1:26:27 AM: ┌ ○ /404 179 B 80.5 kB
1:26:27 AM: ├ λ /api/hello 0 B 80.4 kB
1:26:27 AM: ├ λ /api/music 0 B 80.4 kB
1:26:27 AM: ├ λ /api/post 0 B 80.4 kB
1:26:27 AM: └ λ /api/posts 0 B 80.4 kB
1:26:27 AM: + First Load JS shared by all 80.4 kB
1:26:27 AM: ├ chunks/main-57bcdf542ac79061.js 77.9 kB
1:26:27 AM: ├ chunks/pages/_app-9f5490aa3d56632f.js 192 B
1:26:27 AM: └ chunks/webpack-47a49d2fdd84dda0.js 2.27 kB
1:26:27 AM: λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
1:26:27 AM: ○ (Static) automatically rendered as static HTML (uses no initial props)
1:26:27 AM: Done in 11.80s.
1:26:27 AM:
1:26:27 AM: (build.command completed in 12s)
1:26:27 AM:
1:26:27 AM: ────────────────────────────────────────────────────────────────
1:26:27 AM: 3. @netlify/plugin-nextjs (onBuild event)
1:26:27 AM: ────────────────────────────────────────────────────────────────
1:26:27 AM:
1:26:27 AM: { functionsDir: ‘/opt/build/repo/.netlify/functions-internal’ }
1:26:27 AM: Patching /opt/build/repo/node_modules/next/dist/server/base-server.js
1:26:27 AM: Done
1:26:27 AM: Patching /opt/build/repo/node_modules/next/dist/server/next-server.js
1:26:27 AM: Done
1:26:27 AM: Moving static page files to serve from CDN…
1:26:27 AM: Moved 0 files
1:26:27 AM: Using Netlify Edge Functions for image format detection. Set env var “NEXT_DISABLE_EDGE_IMAGES=true” to disable.
1:26:27 AM: Netlify configuration property “redirects” value changed to [
1:26:27 AM: { from: ‘/next/static/', to: ‘/static/:splat’, status: 200 },
1:26:27 AM: {
1:26:27 AM: from: '/_next/image’,
1:26:27 AM: query: { url: ‘:url’, w: ‘:width’, q: ‘:quality’ },
1:26:27 AM: to: '/ipx/w:width,q:quality/:url’,
1:26:27 AM: status: 301
1:26:27 AM: },
1:26:27 AM: { from: ‘/_ipx/', to: ‘/.netlify/builders/_ipx’, status: 200 },
1:26:27 AM: { from: '/cache/’, to: ‘/404.html’, status: 404, force: true },
1:26:27 AM: { from: ‘/server/', to: ‘/404.html’, status: 404, force: true },
1:26:27 AM: { from: '/serverless/’, to: ‘/404.html’, status: 404, force: true },
1:26:27 AM: { from: ‘/trace’, to: ‘/404.html’, status: 404, force: true },
1:26:27 AM: { from: ‘/traces’, to: ‘/404.html’, status: 404, force: true },
1:26:27 AM: {
1:26:27 AM: from: ‘/routes-manifest.json’,
1:26:27 AM: to: ‘/404.html’,
1:26:27 AM: status: 404,
1:26:27 AM: force: true
1:26:27 AM: },
1:26:27 AM: {
1:26:27 AM: from: ‘/build-manifest.json’,
1:26:27 AM: to: ‘/404.html’,
1:26:27 AM: status: 404,
1:26:27 AM: force: true
1:26:27 AM: },
1:26:27 AM: {
1:26:27 AM: from: ‘/prerender-manifest.json’,
1:26:27 AM: to: ‘/404.html’,
1:26:27 AM: status: 404,
1:26:27 AM: force: true
1:26:27 AM: },
1:26:27 AM: {
1:26:27 AM: from: ‘/react-loadable-manifest.json’,
1:26:27 AM: to: ‘/404.html’,
1:26:27 AM: status: 404,
1:26:27 AM: force: true
1:26:27 AM: },
1:26:27 AM: { from: ‘/BUILD_ID’, to: ‘/404.html’, status: 404, force: true },
1:26:27 AM: {
1:26:27 AM: from: ‘/api/',
1:26:27 AM: to: ‘/.netlify/functions/___netlify-handler’,
1:26:27 AM: status: 200
1:26:27 AM: },
1:26:27 AM: {
1:26:27 AM: from: ‘/favicon.ico’,
1:26:27 AM: to: ‘/favicon.ico’,
1:26:27 AM: conditions: { Cookie: [Array] },
1:26:27 AM: status: 200
1:26:27 AM: },
1:26:27 AM: {
1:26:27 AM: from: ‘/vercel.svg’,
1:26:27 AM: to: ‘/vercel.svg’,
1:26:27 AM: conditions: { Cookie: [Array] },
1:26:27 AM: status: 200
1:26:27 AM: },
1:26:27 AM: {
1:26:27 AM: from: ‘/assets/images/backgroundNoise.png’,
1:26:27 AM: to: ‘/assets/images/backgroundNoise.png’,
1:26:27 AM: conditions: { Cookie: [Array] },
1:26:27 AM: status: 200
1:26:27 AM: },
1:26:27 AM: {
1:26:27 AM: from: ‘/assets/fonts/Nunito/Nunito-Italic-Variable.ttf’,
1:26:27 AM: to: ‘/assets/fonts/Nunito/Nunito-Italic-Variable.ttf’,
1:26:27 AM: conditions: { Cookie: [Array] },
1:26:27 AM: status: 200
1:26:27 AM: },
1:26:27 AM: {
1:26:27 AM: from: ‘/assets/fonts/Nunito/Nunito-Variable.ttf’,
1:26:27 AM: to: ‘/assets/fonts/Nunito/Nunito-Variable.ttf’,
1:26:27 AM: conditions: { Cookie: [Array] },
1:26:27 AM: status: 200
1:26:27 AM: },
1:26:27 AM: {
1:26:27 AM: from: '/’,
1:26:27 AM: to: ‘/.netlify/functions/___netlify-handler’,
1:26:27 AM: status: 200,
1:26:27 AM: conditions: { Cookie: [Array] },
1:26:27 AM: force: true
1:26:27 AM: },
1:26:27 AM: {
1:26:27 AM: from: ‘/_next/data/G9xAS-MJ2ZREGC6-MkXMQ/post/:id.json’,
1:26:27 AM: to: ‘/.netlify/functions/___netlify-handler’,
1:26:27 AM: status: 200,
1:26:27 AM: force: false
1:26:27 AM: },
1:26:27 AM: {
1:26:27 AM: from: ‘/post/:id’,
1:26:27 AM: to: ‘/.netlify/functions/___netlify-handler’,
1:26:27 AM: status: 200,
1:26:27 AM: force: false
1:26:27 AM: },
1:26:27 AM: {
1:26:27 AM: from: ‘/*’,
1:26:27 AM: to: ‘/.netlify/functions/___netlify-handler’,
1:26:27 AM: status: 200
1:26:27 AM: }
1:26:27 AM: ].
1:26:27 AM:
1:26:27 AM: (@netlify/plugin-nextjs onBuild completed in 92ms)
1:26:27 AM:
1:26:27 AM: ────────────────────────────────────────────────────────────────
1:26:27 AM: 4. Functions bundling
1:26:27 AM: ────────────────────────────────────────────────────────────────
1:26:27 AM:
1:26:27 AM: Packaging Functions from .netlify/functions-internal directory:
1:26:27 AM: - ___netlify-handler/___netlify-handler.js
1:26:27 AM: - ___netlify-odb-handler/___netlify-odb-handler.js
1:26:27 AM: - _ipx/_ipx.js
1:26:27 AM:
1:26:42 AM:
1:26:42 AM: (Functions bundling completed in 14.9s)
1:26:42 AM:
1:26:42 AM: ────────────────────────────────────────────────────────────────
1:26:42 AM: 5. Edge Functions bundling
1:26:42 AM: ────────────────────────────────────────────────────────────────
1:26:42 AM:
1:26:42 AM: Packaging Edge Functions from .netlify/edge-functions directory:
1:26:42 AM: - ipx
1:26:43 AM:
1:26:43 AM: (Edge Functions bundling completed in 787ms)
1:26:43 AM:
1:26:43 AM: ────────────────────────────────────────────────────────────────
1:26:43 AM: 6. @netlify/plugin-nextjs (onPostBuild event)
1:26:43 AM: ────────────────────────────────────────────────────────────────
1:26:43 AM:
1:26:43 AM: Next.js cache saved.
1:26:43 AM:
1:26:43 AM: (@netlify/plugin-nextjs onPostBuild completed in 93ms)
1:26:43 AM:
1:26:43 AM: Creating deploy upload records
1:26:43 AM: ────────────────────────────────────────────────────────────────
1:26:43 AM: 7. Deploy site
1:26:43 AM: ────────────────────────────────────────────────────────────────
1:26:43 AM:
1:26:43 AM: Starting to deploy site from ‘.next’
1:26:43 AM: Creating deploy tree
1:26:44 AM: 42 new files to upload
1:26:44 AM: 3 new functions to upload
1:26:51 AM: Site deploy was successfully initiated
1:26:51 AM:
1:26:51 AM: (Deploy site completed in 8.3s)
1:26:52 AM:
1:26:52 AM: ────────────────────────────────────────────────────────────────
1:26:52 AM: Netlify Build Complete
1:26:52 AM: ────────────────────────────────────────────────────────────────
1:26:52 AM:
1:26:52 AM: (Netlify Build completed in 37.9s)
1:26:52 AM: Starting post processing
1:26:52 AM: Caching artifacts
1:26:52 AM: Started saving node modules
1:26:52 AM: Finished saving node modules
1:26:52 AM: Started saving build plugins
1:26:52 AM: Finished saving build plugins
1:26:52 AM: Started saving yarn cache
1:26:52 AM: Post processing - HTML
1:26:52 AM: Post processing - header rules
1:26:53 AM: Post processing - redirect rules
1:26:53 AM: Post processing done
1:26:54 AM: Finished saving yarn cache
1:26:54 AM: Started saving pip cache
1:26:54 AM: Finished saving pip cache
1:26:54 AM: Started saving emacs cask dependencies
1:26:54 AM: Finished saving emacs cask dependencies
1:26:54 AM: Started saving maven dependencies
1:26:54 AM: Finished saving maven dependencies
1:26:54 AM: Started saving boot dependencies
1:26:54 AM: Finished saving boot dependencies
1:26:54 AM: Started saving rust rustup cache
1:26:54 AM: Finished saving rust rustup cache
1:26:54 AM: Started saving go dependencies
1:26:54 AM: Finished saving go dependencies
1:26:54 AM: Build script success
1:26:57 AM: Site is live
1:26:59 AM: Uploading Cache of size 1.3GB
1:27:07 AM: Finished processing build request in 1m28.97348427s