I’m getting a 500 internal server error when deploying nextjs 13.4 to netlify even though my build succeeded. Here is my build log
5:02:30 PM: Netlify Build
5:02:30 PM: ────────────────────────────────────────────────────────────────
5:02:30 PM:
5:02:30 PM: ❯ Version
5:02:30 PM: @netlify/build 29.11.7
5:02:30 PM:
5:02:30 PM: ❯ Flags
5:02:30 PM: baseRelDir: true
5:02:30 PM: buildId: 647a045b92e0be000873ef9f
5:02:30 PM: deployId: 647a045b92e0be000873efa1
5:02:31 PM:
5:02:31 PM: ❯ Current directory
5:02:31 PM: /opt/build/repo
5:02:31 PM:
5:02:31 PM: ❯ Config file
5:02:31 PM: No config file was defined: using default values.
5:02:31 PM:
5:02:31 PM: ❯ Context
5:02:31 PM: production
5:02:31 PM:
5:02:31 PM: ❯ Using Next.js Runtime - v4.37.4
5:02:32 PM:
5:02:32 PM: @netlify/plugin-nextjs (onPreBuild event)
5:02:32 PM: ────────────────────────────────────────────────────────────────
5:02:32 PM:
5:02:32 PM: Next.js cache restored.
5:02:32 PM: Netlify configuration property "build.environment.NEXT_PRIVATE_TARGET" value changed.
5:02:32 PM:
5:02:32 PM: (@netlify/plugin-nextjs onPreBuild completed in 106ms)
5:02:32 PM:
5:02:32 PM: Build command from Netlify app
5:02:32 PM: ────────────────────────────────────────────────────────────────
5:02:32 PM:
5:02:32 PM: $ next build
5:02:32 PM: - warn You are using a non-standard "NODE_ENV" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://nextjs.org/docs/messages/non-standard-node-env
5:02:32 PM: - warn You have enabled experimental feature (serverComponentsExternalPackages) in next.config.js.
5:02:32 PM: - warn Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use at your own risk.
5:02:32 PM: - info Creating an optimized production build...
5:02:47 PM: - info Compiled successfully
5:02:47 PM: - info Linting and checking validity of types...
5:02:49 PM: ./src/app/oferty/OffersPage.tsx
5:02:49 PM: 63:6 Warning: React Hook useMemo has unnecessary dependencies: 'city', 'query', and 'sorting'. Either exclude them or remove the dependency array. react-hooks/exhaustive-deps
5:02:49 PM: info - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
5:02:51 PM: - info Collecting page data...
5:03:02 PM: - info Generating static pages (0/14)
5:03:02 PM: connecting
5:03:03 PM: - info Generating static pages (3/14)
5:03:03 PM: connecting
5:03:03 PM: - info Generating static pages (6/14)
5:03:03 PM: connecting
5:03:03 PM: connecting
5:03:03 PM: Mongoose connected
5:03:03 PM: - info Generating static pages (10/14)
5:03:03 PM: connecting
5:03:03 PM: Mongoose connected
5:03:04 PM: Mongoose connected
5:03:04 PM: Mongoose connected
5:03:04 PM: Mongoose connected
5:03:04 PM: - info Generating static pages (14/14)
5:03:05 PM: - info Finalizing page optimization...
5:03:05 PM: Route (app) Size First Load JS
5:03:05 PM: ┌ λ / 12.5 kB 102 kB
5:03:05 PM: ├ λ /admin 0 B 0 B
5:03:05 PM: ├ λ /admin/accept 0 B 0 B
5:03:05 PM: ├ λ /admin/reject 0 B 0 B
5:03:05 PM: ├ ○ /api/oferty 0 B 0 B
5:03:05 PM: ├ λ /blog 0 B 0 B
5:03:05 PM: ├ λ /login 0 B 0 B
5:03:05 PM: ├ λ /o-nas 299 B 87.9 kB
5:03:05 PM: ├ λ /oferty 79 kB 168 kB
5:03:05 PM: ├ λ /oferty/[trainerId] 144 B 77.4 kB
5:03:05 PM: ├ λ /profil 0 B 0 B
5:03:05 PM: ├ λ /rejestracja 0 B 0 B
5:03:05 PM: └ λ /rejestracja-trenera 0 B 0 B
5:03:05 PM: + First Load JS shared by all 77.3 kB
5:03:05 PM: ├ chunks/2443530c-c645f84d4e7c97b6.js 50.5 kB
5:03:05 PM: ├ chunks/488-5d01cf1df4bf2569.js 24.7 kB
5:03:05 PM: ├ chunks/main-app-60bfd79544e207f2.js 214 B
5:03:05 PM: └ chunks/webpack-9cc7d3fab8172e51.js 1.8 kB
5:03:05 PM: Route (pages) Size First Load JS
5:03:05 PM: ┌ ○ /404 181 B 74.9 kB
5:03:05 PM: ├ λ /api/auth/[...nextauth] 0 B 74.7 kB
5:03:05 PM: ├ λ /api/rejestracja 0 B 74.7 kB
5:03:05 PM: └ λ /api/rejestracja-trenera 0 B 74.7 kB
5:03:05 PM: + First Load JS shared by all 74.7 kB
5:03:05 PM: ├ chunks/framework-8883d1e9be70c3da.js 45.1 kB
5:03:05 PM: ├ chunks/main-ded1f25c60071b4a.js 27.7 kB
5:03:05 PM: ├ chunks/pages/_app-b555d5e1eab47959.js 195 B
5:03:05 PM: └ chunks/webpack-9cc7d3fab8172e51.js 1.8 kB
5:03:05 PM: λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
5:03:05 PM: ○ (Static) automatically rendered as static HTML (uses no initial props)
5:03:05 PM:
5:03:05 PM: (build.command completed in 33.5s)
5:03:05 PM:
5:03:05 PM: @netlify/plugin-nextjs (onBuild event)
5:03:05 PM: ────────────────────────────────────────────────────────────────
5:03:05 PM:
5:03:05 PM: NextAuth package detected, setting NEXTAUTH_URL environment variable to https://coach-base.netlify.app
5:03:06 PM: Patching /opt/build/repo/node_modules/next/dist/server/base-server.js
5:03:06 PM: Done
5:03:06 PM: Patching /opt/build/repo/node_modules/next/dist/server/next-server.js
5:03:06 PM: Done
5:03:06 PM: Moving static page files to serve from CDN...
5:03:06 PM: Moved 2 files
5:03:06 PM: You are not using Netlify Edge Functions for image format detection. Set env var "NEXT_FORCE_EDGE_IMAGES=true" to enable.
5:03:06 PM: Netlify configuration property "redirects" value changed to [
5:03:06 PM: { from: '/_next/static/*', to: '/static/:splat', status: 200 },
5:03:06 PM: {
5:03:06 PM: from: '/_next/image*',
5:03:06 PM: query: { url: ':url', w: ':width', q: ':quality' },
5:03:06 PM: to: '/_ipx/w_:width,q_:quality/:url',
5:03:06 PM: status: 301
5:03:06 PM: },
5:03:06 PM: { from: '/_ipx/*', to: '/.netlify/builders/_ipx', status: 200 },
5:03:06 PM: {
5:03:06 PM: from: '/api/auth/:nextauth/*',
5:03:06 PM: to: '/.netlify/functions/api-0',
5:03:06 PM: status: 200
5:03:06 PM: },
5:03:06 PM: {
5:03:06 PM: from: '/api/rejestracja',
5:03:06 PM: to: '/.netlify/functions/api-0',
5:03:06 PM: status: 200
5:03:06 PM: },
5:03:06 PM: {
5:03:06 PM: from: '/api/rejestracja-trenera',
5:03:06 PM: to: '/.netlify/functions/api-0',
5:03:06 PM: status: 200
5:03:06 PM: },
5:03:06 PM: {
5:03:06 PM: from: '/api/*',
5:03:06 PM: to: '/.netlify/functions/___netlify-handler',
5:03:06 PM: status: 200
5:03:06 PM: },
5:03:06 PM: {
5:03:06 PM: from: '/assets/barbell.jpg',
5:03:06 PM: to: '/assets/barbell.jpg',
5:03:06 PM: conditions: { Cookie: [Array] },
5:03:06 PM: status: 200
5:03:06 PM: },
5:03:06 PM: {
5:03:06 PM: from: '/assets/barbell2.jpg',
5:03:06 PM: to: '/assets/barbell2.jpg',
5:03:06 PM: conditions: { Cookie: [Array] },
5:03:06 PM: status: 200
5:03:06 PM: },
5:03:06 PM: {
5:03:06 PM: from: '/assets/gym-interior.jpg',
5:03:06 PM: to: '/assets/gym-interior.jpg',
5:03:06 PM: conditions: { Cookie: [Array] },
5:03:06 PM: status: 200
5:03:06 PM: },
5:03:06 PM: {
5:03:06 PM: from: '/assets/undraw_hiring_re_yk5n.svg',
5:03:06 PM: to: '/assets/undraw_hiring_re_yk5n.svg',
5:03:06 PM: conditions: { Cookie: [Array] },
5:03:06 PM: status: 200
5:03:06 PM: },
5:03:06 PM: {
5:03:06 PM: from: '/assets/undraw_personal_info_re_ur1n.svg',
5:03:06 PM: to: '/assets/undraw_personal_info_re_ur1n.svg',
5:03:06 PM: conditions: { Cookie: [Array] },
5:03:06 PM: status: 200
5:03:06 PM: },
5:03:06 PM: {
5:03:06 PM: from: '/*',
5:03:06 PM: to: '/.netlify/functions/___netlify-handler',
5:03:06 PM: status: 200,
5:03:06 PM: conditions: { Cookie: [Array] },
5:03:06 PM: force: true
5:03:06 PM: },
5:03:06 PM: {
5:03:06 PM: from: '/_next/data/sI0Ra4b8IZfYq5NntGf8P/index.json',
5:03:06 PM: to: '/.netlify/functions/___netlify-handler',
5:03:06 PM: status: 200,
5:03:06 PM: force: false
5:03:06 PM: },
5:03:06 PM: {
5:03:06 PM: from: '/',
5:03:06 PM: to: '/.netlify/functions/___netlify-handler',
5:03:06 PM: status: 200,
5:03:06 PM: force: false
5:03:06 PM: },
5:03:06 PM: {
5:03:06 PM: from: '/_next/data/sI0Ra4b8IZfYq5NntGf8P/admin.json',
5:03:06 PM: to: '/.netlify/functions/___netlify-handler',
5:03:06 PM: status: 200,
5:03:06 PM: force: false
5:03:06 PM: },
5:03:06 PM: {
5:03:06 PM: from: '/admin',
5:03:06 PM: to: '/.netlify/functions/___netlify-handler',
5:03:06 PM: status: 200,
5:03:06 PM: force: false
5:03:06 PM: },
5:03:06 PM: {
5:03:06 PM: from: '/_next/data/sI0Ra4b8IZfYq5NntGf8P/admin/accept.json',
5:03:06 PM: to: '/.netlify/functions/___netlify-handler',
5:03:06 PM: status: 200,
5:03:06 PM: force: false
5:03:06 PM: },
5:03:06 PM: {
5:03:06 PM: from: '/admin/accept',
5:03:06 PM: to: '/.netlify/functions/___netlify-handler',
5:03:06 PM: status: 200,
5:03:06 PM: force: false
5:03:06 PM: },
5:03:06 PM: {
5:03:06 PM: from: '/_next/data/sI0Ra4b8IZfYq5NntGf8P/admin/reject.json',
5:03:06 PM: to: '/.netlify/functions/___netlify-handler',
5:03:06 PM: status: 200,
5:03:06 PM: force: false
5:03:06 PM: },
5:03:06 PM: {
5:03:06 PM: from: '/admin/reject',
5:03:06 PM: to: '/.netlify/functions/___netlify-handler',
5:03:06 PM: status: 200,
5:03:06 PM: force: false
5:03:06 PM: },
5:03:06 PM: {
5:03:06 PM: from: '/_next/data/sI0Ra4b8IZfYq5NntGf8P/blog.json',
5:03:06 PM: to: '/.netlify/functions/___netlify-handler',
5:03:06 PM: status: 200,
5:03:06 PM: force: false
5:03:06 PM: },
5:03:06 PM: {
5:03:06 PM: from: '/blog',
5:03:06 PM: to: '/.netlify/functions/___netlify-handler',
5:03:06 PM: status: 200,
5:03:06 PM: force: false
5:03:06 PM: },
5:03:06 PM: {
5:03:06 PM: from: '/_next/data/sI0Ra4b8IZfYq5NntGf8P/login.json',
5:03:06 PM: to: '/.netlify/functions/___netlify-handler',
5:03:06 PM: status: 200,
5:03:06 PM: force: false
5:03:06 PM: },
5:03:06 PM: {
5:03:06 PM: from: '/login',
5:03:06 PM: to: '/.netlify/functions/___netlify-handler',
5:03:06 PM: status: 200,
5:03:06 PM: force: false
5:03:06 PM: },
5:03:06 PM: {
5:03:06 PM: from: '/_next/data/sI0Ra4b8IZfYq5NntGf8P/o-nas.json',
5:03:06 PM: to: '/.netlify/functions/___netlify-handler',
5:03:06 PM: status: 200,
5:03:06 PM: force: false
5:03:06 PM: },
5:03:06 PM: {
5:03:06 PM: from: '/o-nas',
5:03:06 PM: to: '/.netlify/functions/___netlify-handler',
5:03:06 PM: status: 200,
5:03:06 PM: force: false
5:03:06 PM: },
5:03:06 PM: {
5:03:06 PM: from: '/_next/data/sI0Ra4b8IZfYq5NntGf8P/oferty.json',
5:03:06 PM: to: '/.netlify/functions/___netlify-handler',
5:03:06 PM: status: 200,
5:03:06 PM: force: false
5:03:06 PM: },
5:03:06 PM: {
5:03:06 PM: from: '/oferty',
5:03:06 PM: to: '/.netlify/functions/___netlify-handler',
5:03:06 PM: status: 200,
5:03:06 PM: force: false
5:03:06 PM: },
5:03:06 PM: {
5:03:06 PM: from: '/_next/data/sI0Ra4b8IZfYq5NntGf8P/profil.json',
5:03:06 PM: to: '/.netlify/functions/___netlify-handler',
5:03:06 PM: status: 200,
5:03:06 PM: force: false
5:03:06 PM: },
5:03:06 PM: {
5:03:06 PM: from: '/profil',
5:03:06 PM: to: '/.netlify/functions/___netlify-handler',
5:03:06 PM: status: 200,
5:03:06 PM: force: false
5:03:06 PM: },
5:03:06 PM: {
5:03:06 PM: from: '/_next/data/sI0Ra4b8IZfYq5NntGf8P/rejestracja.json',
5:03:06 PM: to: '/.netlify/functions/___netlify-handler',
5:03:06 PM: status: 200,
5:03:06 PM: force: false
5:03:06 PM: },
5:03:06 PM: {
5:03:06 PM: from: '/rejestracja',
5:03:06 PM: to: '/.netlify/functions/___netlify-handler',
5:03:06 PM: status: 200,
5:03:06 PM: force: false
5:03:06 PM: },
5:03:06 PM: {
5:03:06 PM: from: '/_next/data/sI0Ra4b8IZfYq5NntGf8P/rejestracja-trenera.json',
5:03:06 PM: to: '/.netlify/functions/___netlify-handler',
5:03:06 PM: status: 200,
5:03:06 PM: force: false
5:03:06 PM: },
5:03:06 PM: {
5:03:06 PM: from: '/rejestracja-trenera',
5:03:06 PM: to: '/.netlify/functions/___netlify-handler',
5:03:06 PM: status: 200,
5:03:06 PM: force: false
5:03:06 PM: },
5:03:06 PM: {
5:03:06 PM: from: '/_next/data/sI0Ra4b8IZfYq5NntGf8P/oferty/:trainerId.json',
5:03:06 PM: to: '/.netlify/functions/___netlify-handler',
5:03:06 PM: status: 200,
5:03:06 PM: force: false
5:03:06 PM: },
5:03:06 PM: {
5:03:06 PM: from: '/oferty/:trainerId',
5:03:06 PM: to: '/.netlify/functions/___netlify-handler',
5:03:06 PM: status: 200,
5:03:06 PM: force: false
5:03:06 PM: },
5:03:06 PM: {
5:03:06 PM: from: '/*',
5:03:06 PM: to: '/.netlify/functions/___netlify-handler',
5:03:06 PM: status: 200
5:03:06 PM: }
5:03:06 PM: ].
5:03:06 PM:
5:03:06 PM: (@netlify/plugin-nextjs onBuild completed in 427ms)
5:03:06 PM:
5:03:06 PM: Functions bundling
5:03:06 PM: ────────────────────────────────────────────────────────────────
5:03:06 PM:
5:03:06 PM: Packaging Functions from .netlify/functions-internal directory:
5:03:06 PM: - ___netlify-handler/___netlify-handler.js
5:03:06 PM: - ___netlify-odb-handler/___netlify-odb-handler.js
5:03:06 PM: - _ipx/_ipx.js
5:03:06 PM: - api-0/api-0.js
5:03:06 PM:
5:03:34 PM:
5:03:34 PM: (Functions bundling completed in 28.3s)
5:03:34 PM:
5:03:34 PM: Edge Functions bundling
5:03:34 PM: ────────────────────────────────────────────────────────────────
5:03:34 PM:
5:03:35 PM:
5:03:35 PM: (Edge Functions bundling completed in 315ms)
5:03:35 PM:
5:03:35 PM: @netlify/plugin-nextjs (onPostBuild event)
5:03:35 PM: ────────────────────────────────────────────────────────────────
5:03:35 PM:
5:03:35 PM: Next.js cache saved.
5:03:35 PM: 🧪 Thank you for testing "appDir" support on Netlify. For known issues and to give feedback, visit https://ntl.fyi/next-13-feedback
5:03:35 PM:
5:03:35 PM: (@netlify/plugin-nextjs onPostBuild completed in 177ms)
5:03:35 PM:
5:03:43 PM: (Netlify Build completed in 1m 12.7s)
5:03:44 PM: Section completed: building
5:03:47 PM: Finished processing build request in 1m35.627s
My netlify site: coach-base.netlify.app