NextJS API endpoint hosted on Netlify returns "Internal Server Error" on all new commits

  • we need to know your netlify site name.
    trusting-ride-ba202c.netlify.app

  • DNS issues? Tell us the custom domain, tell us the error message! We can’t help if we don’t know your domain.
    skedge.pro

  • Build problems? Link or paste the FULL build log & build settings screenshot

10:02:57 AM: build-image version: a8447da70f77f92b7813b5e93ee9b81ed7ae5f55 (focal)
10:02:57 AM: buildbot version: a8447da70f77f92b7813b5e93ee9b81ed7ae5f55
10:02:57 AM: Fetching cached dependencies
10:02:57 AM: Starting to download cache of 217.5MB
10:03:00 AM: Finished downloading cache in 3.009s
10:03:00 AM: Starting to extract cache
10:03:02 AM: Finished extracting cache in 1.617s
10:03:02 AM: Finished fetching cache in 4.736s
10:03:02 AM: Starting to prepare the repo for build
10:03:02 AM: Preparing Git Reference refs/heads/main
10:03:03 AM: Parsing package.json dependencies
10:03:04 AM: Different publish path detected, going to use the one specified in the Netlify configuration file: '.next' versus 'out' in the Netlify UI
10:03:04 AM: Starting to install dependencies
10:03:04 AM: Python version set to 3.8
10:03:04 AM: Attempting Ruby version 2.7.2, read from environment
10:03:05 AM: Using Ruby version 2.7.2
10:03:05 AM: Started restoring cached go cache
10:03:05 AM: Finished restoring cached go cache
10:03:05 AM: Installing Go version 1.14.4 (requested 1.14.4)
10:03:09 AM: go version go1.14.4 linux/amd64
10:03:09 AM: Using PHP version 8.0
10:03:10 AM: Started restoring cached Node.js version
10:03:11 AM: Finished restoring cached Node.js version
10:03:11 AM: v18.16.0 is already installed.
10:03:11 AM: Now using node v18.16.0 (npm v9.5.1)
10:03:11 AM: Enabling Node.js Corepack
10:03:12 AM: Started restoring cached build plugins
10:03:12 AM: Finished restoring cached build plugins
10:03:12 AM: Started restoring cached corepack dependencies
10:03:12 AM: Finished restoring cached corepack dependencies
10:03:12 AM: jq: error (at <stdin>:73): Cannot iterate over null (null)
10:03:12 AM: No npm workspaces detected
10:03:12 AM: Started restoring cached node modules
10:03:12 AM: Finished restoring cached node modules
10:03:12 AM: Installing npm packages using npm version 9.5.1
10:03:13 AM: up to date, audited 522 packages in 605ms
10:03:13 AM: 156 packages are looking for funding
10:03:13 AM:   run `npm fund` for details
10:03:13 AM: found 0 vulnerabilities
10:03:13 AM: npm packages installed
10:03:13 AM: Install dependencies script success
10:03:13 AM: Starting build script
10:03:14 AM: Detected 1 framework(s)
10:03:14 AM: "next" at version "13.4.1"
10:03:14 AM: Section completed: initializing
10:03:15 AM: ​
10:03:15 AM: Netlify Build                                                 
10:03:15 AM: ────────────────────────────────────────────────────────────────
10:03:15 AM: ​
10:03:15 AM: ❯ Version
10:03:15 AM:   @netlify/build 29.11.5
10:03:15 AM: ​
10:03:15 AM: ❯ Flags
10:03:15 AM:   baseRelDir: true
10:03:15 AM:   buildId: 646508bd5dc8ce00080aed3f
10:03:15 AM:   deployId: 646508bd5dc8ce00080aed41
10:03:15 AM: ​
10:03:15 AM: ❯ Current directory
10:03:15 AM:   /opt/build/repo
10:03:15 AM: ​
10:03:15 AM: ❯ Config file
10:03:15 AM:   /opt/build/repo/netlify.toml
10:03:15 AM: ​
10:03:15 AM: ❯ Context
10:03:15 AM:   production
10:03:15 AM: ​
10:03:15 AM: ❯ Using Next.js Runtime - v4.36.0
10:03:15 AM: ​
10:03:15 AM: ❯ Outdated plugins
10:03:15 AM:    - @netlify/plugin-nextjs@4.36.0: latest version is 4.37.1
10:03:15 AM:      To upgrade this plugin, please update its version in "package.json"
10:03:16 AM: ​
10:03:16 AM: @netlify/plugin-nextjs (onPreBuild event)                     
10:03:16 AM: ────────────────────────────────────────────────────────────────
10:03:16 AM: ​
10:03:16 AM: Next.js cache restored.
10:03:16 AM: Netlify configuration property "build.environment.NEXT_PRIVATE_TARGET" value changed.
10:03:16 AM: ​
10:03:16 AM: (@netlify/plugin-nextjs onPreBuild completed in 70ms)
10:03:16 AM: ​
10:03:16 AM: Build command from Netlify app                                
10:03:16 AM: ────────────────────────────────────────────────────────────────
10:03:16 AM: ​
10:03:16 AM: $ npm run build
10:03:17 AM: > skedge@1.3.2 build
10:03:17 AM: > next build
10:03:17 AM: - info Linting and checking validity of types...
10:03:19 AM: - info Creating an optimized production build...
10:03:22 AM: - info Compiled successfully
10:03:22 AM: - info Collecting page data...
10:03:24 AM: - info Generating static pages (0/11)
10:03:24 AM: - info Generating static pages (2/11)
10:03:24 AM: - info Generating static pages (5/11)
10:03:24 AM: - info Generating static pages (8/11)
10:03:24 AM: - info Generating static pages (11/11)
10:03:25 AM: - info Finalizing page optimization...
10:03:25 AM: Route (pages)                              Size     First Load JS
10:03:25 AM: ┌ ○ /                                      1.8 kB         80.3 kB
10:03:25 AM: ├   └ css/01e5dfe07ae7d9f1.css             1.2 kB
10:03:25 AM: ├   /_app                                  0 B              76 kB
10:03:25 AM: ├ ○ /404                                   511 B           205 kB
10:03:25 AM: ├   └ css/c6365ba9d818e809.css             1.25 kB
10:03:25 AM: ├ λ /api/[...slug]                         0 B              76 kB
10:03:25 AM: ├ λ /api/create                            0 B              76 kB
10:03:25 AM: ├ λ /api/health                            0 B              76 kB
10:03:25 AM: ├ λ /api/post-user                         0 B              76 kB
10:03:25 AM: ├ λ /api/update-event                      0 B              76 kB
10:03:25 AM: ├ ○ /create                                48.3 kB         253 kB
10:03:25 AM: ├   └ css/4a5f02915aa40256.css             4.89 kB
10:03:25 AM: ├ ○ /event/[eventId]                       267 B           218 kB
10:03:25 AM: ├ ○ /event/[eventId]/[userId]              279 B           218 kB
10:03:25 AM: ├ ○ /learn                                 2.84 kB        81.4 kB
10:03:25 AM: ├   └ css/2015b4f8cf11bc38.css             1.46 kB
10:03:25 AM: ├ ○ /testing/create-fail                   565 B           205 kB
10:03:25 AM: ├   └ css/e799ea584f7982e3.css             1.26 kB
10:03:25 AM: ├ ○ /testing/create-pending                1.78 kB        80.3 kB
10:03:25 AM: ├   └ css/8b7a544ba92b9c84.css             1.12 kB
10:03:25 AM: ├ ○ /testing/event-fail                    541 B           205 kB
10:03:25 AM: ├   └ css/2cb9de7df0bc8591.css             1.25 kB
10:03:25 AM: └ ○ /testing/event-loading                 3.59 kB         161 kB
10:03:25 AM:     └ css/23e3860ed66891b4.css             1.16 kB
10:03:25 AM: + First Load JS shared by all              76.3 kB
10:03:25 AM:   ├ chunks/framework-cda2f1305c3d9424.js   45.2 kB
10:03:25 AM:   ├ chunks/main-d81e5f7385263f04.js        29.7 kB
10:03:25 AM:   ├ chunks/pages/_app-1915ca3a4cdaee6b.js  286 B
10:03:25 AM:   ├ chunks/webpack-60d328ea1049e7c2.js     762 B
10:03:25 AM:   └ css/28d3673224a70017.css               307 B
10:03:25 AM: λ  (Server)  server-side renders at runtime (uses getInitialProps or getServerSideProps)
10:03:25 AM: ○  (Static)  automatically rendered as static HTML (uses no initial props)
10:03:25 AM: ​
10:03:25 AM: (build.command completed in 8.1s)
10:03:25 AM: ​
10:03:25 AM: @netlify/plugin-nextjs (onBuild event)                        
10:03:25 AM: ────────────────────────────────────────────────────────────────
10:03:25 AM: ​
10:03:25 AM: Patching /opt/build/repo/node_modules/next/dist/server/base-server.js
10:03:25 AM: Done
10:03:25 AM: Patching /opt/build/repo/node_modules/next/dist/server/next-server.js
10:03:25 AM: Done
10:03:25 AM: Moving static page files to serve from CDN...
10:03:25 AM: Moving /opt/build/repo/.next/server/pages/create.html to /opt/build/repo/.next/create.html
10:03:25 AM: Moving /opt/build/repo/.next/server/pages/index.html to /opt/build/repo/.next/index.html
10:03:25 AM: Moving /opt/build/repo/.next/server/pages/learn.html to /opt/build/repo/.next/learn.html
10:03:25 AM: Moving /opt/build/repo/.next/server/pages/testing/create-fail.html to /opt/build/repo/.next/testing/create-fail.html
10:03:25 AM: Moving /opt/build/repo/.next/server/pages/testing/create-pending.html to /opt/build/repo/.next/testing/create-pending.html
10:03:25 AM: Moving /opt/build/repo/.next/server/pages/testing/event-fail.html to /opt/build/repo/.next/testing/event-fail.html
10:03:25 AM: Moving /opt/build/repo/.next/server/pages/testing/event-loading.html to /opt/build/repo/.next/testing/event-loading.html
10:03:25 AM: Moved 7 files
10:03:25 AM: You are not using Netlify Edge Functions for image format detection. Set env var "NEXT_FORCE_EDGE_IMAGES=true" to enable.
10:03:25 AM: Netlify configuration property "redirects" value changed to [
10:03:25 AM:   { from: '/_next/static/*', to: '/static/:splat', status: 200 },
10:03:25 AM:   {
10:03:25 AM:     from: '/_next/image*',
10:03:25 AM:     query: { url: ':url', w: ':width', q: ':quality' },
10:03:25 AM:     to: '/_ipx/w_:width,q_:quality/:url',
10:03:25 AM:     status: 301
10:03:25 AM:   },
10:03:25 AM:   { from: '/_ipx/*', to: '/.netlify/builders/_ipx', status: 200 },
10:03:25 AM:   { from: '/cache/*', to: '/404.html', status: 404, force: true },
10:03:25 AM:   { from: '/server/*', to: '/404.html', status: 404, force: true },
10:03:25 AM:   { from: '/serverless/*', to: '/404.html', status: 404, force: true },
10:03:25 AM:   { from: '/trace', to: '/404.html', status: 404, force: true },
10:03:25 AM:   { from: '/traces', to: '/404.html', status: 404, force: true },
10:03:25 AM:   {
10:03:25 AM:     from: '/routes-manifest.json',
10:03:25 AM:     to: '/404.html',
10:03:25 AM:     status: 404,
10:03:25 AM:     force: true
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/build-manifest.json',
10:03:25 AM:     to: '/404.html',
10:03:25 AM:     status: 404,
10:03:25 AM:     force: true
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/prerender-manifest.json',
10:03:25 AM:     to: '/404.html',
10:03:25 AM:     status: 404,
10:03:25 AM:     force: true
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/react-loadable-manifest.json',
10:03:25 AM:     to: '/404.html',
10:03:25 AM:     status: 404,
10:03:25 AM:     force: true
10:03:25 AM:   },
10:03:25 AM:   { from: '/BUILD_ID', to: '/404.html', status: 404, force: true },
10:03:25 AM:   {
10:03:25 AM:     from: '/api/*',
10:03:25 AM:     to: '/.netlify/functions/___netlify-handler',
10:03:25 AM:     status: 200
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/favicon.ico',
10:03:25 AM:     to: '/favicon.ico',
10:03:25 AM:     conditions: { Cookie: [Array] },
10:03:25 AM:     status: 200
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/vercel.svg',
10:03:25 AM:     to: '/vercel.svg',
10:03:25 AM:     conditions: { Cookie: [Array] },
10:03:25 AM:     status: 200
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/fonts/ArchitectsDaughter-license.txt',
10:03:25 AM:     to: '/fonts/ArchitectsDaughter-license.txt',
10:03:25 AM:     conditions: { Cookie: [Array] },
10:03:25 AM:     status: 200
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/fonts/ArchitectsDaughter.ttf',
10:03:25 AM:     to: '/fonts/ArchitectsDaughter.ttf',
10:03:25 AM:     conditions: { Cookie: [Array] },
10:03:25 AM:     status: 200
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/fonts/Handlee-license.txt',
10:03:25 AM:     to: '/fonts/Handlee-license.txt',
10:03:25 AM:     conditions: { Cookie: [Array] },
10:03:25 AM:     status: 200
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/fonts/Handlee.ttf',
10:03:25 AM:     to: '/fonts/Handlee.ttf',
10:03:25 AM:     conditions: { Cookie: [Array] },
10:03:25 AM:     status: 200
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/images/skedge-accept-gray.json',
10:03:25 AM:     to: '/images/skedge-accept-gray.json',
10:03:25 AM:     conditions: { Cookie: [Array] },
10:03:25 AM:     status: 200
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/images/skedge-accept-gray.svg',
10:03:25 AM:     to: '/images/skedge-accept-gray.svg',
10:03:25 AM:     conditions: { Cookie: [Array] },
10:03:25 AM:     status: 200
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/images/skedge-accept.json',
10:03:25 AM:     to: '/images/skedge-accept.json',
10:03:25 AM:     conditions: { Cookie: [Array] },
10:03:25 AM:     status: 200
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/images/skedge-accept.svg',
10:03:25 AM:     to: '/images/skedge-accept.svg',
10:03:25 AM:     conditions: { Cookie: [Array] },
10:03:25 AM:     status: 200
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/images/skedge-decline-gray.json',
10:03:25 AM:     to: '/images/skedge-decline-gray.json',
10:03:25 AM:     conditions: { Cookie: [Array] },
10:03:25 AM:     status: 200
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/images/skedge-decline-gray.svg',
10:03:25 AM:     to: '/images/skedge-decline-gray.svg',
10:03:25 AM:     conditions: { Cookie: [Array] },
10:03:25 AM:     status: 200
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/images/skedge-decline.json',
10:03:25 AM:     to: '/images/skedge-decline.json',
10:03:25 AM:     conditions: { Cookie: [Array] },
10:03:25 AM:     status: 200
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/images/skedge-decline.svg',
10:03:25 AM:     to: '/images/skedge-decline.svg',
10:03:25 AM:     conditions: { Cookie: [Array] },
10:03:25 AM:     status: 200
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/images/skedge-delete.svg',
10:03:25 AM:     to: '/images/skedge-delete.svg',
10:03:25 AM:     conditions: { Cookie: [Array] },
10:03:25 AM:     status: 200
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/images/skedge-expander-icon.svg',
10:03:25 AM:     to: '/images/skedge-expander-icon.svg',
10:03:25 AM:     conditions: { Cookie: [Array] },
10:03:25 AM:     status: 200
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/images/skedge-hamburger-outline.svg',
10:03:25 AM:     to: '/images/skedge-hamburger-outline.svg',
10:03:25 AM:     conditions: { Cookie: [Array] },
10:03:25 AM:     status: 200
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/images/skedge-hamburger.svg',
10:03:25 AM:     to: '/images/skedge-hamburger.svg',
10:03:25 AM:     conditions: { Cookie: [Array] },
10:03:25 AM:     status: 200
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/images/skedge-heart.svg',
10:03:25 AM:     to: '/images/skedge-heart.svg',
10:03:25 AM:     conditions: { Cookie: [Array] },
10:03:25 AM:     status: 200
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/images/skedge-hearts.gif',
10:03:25 AM:     to: '/images/skedge-hearts.gif',
10:03:25 AM:     conditions: { Cookie: [Array] },
10:03:25 AM:     status: 200
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/images/skedge-icon-outline.svg',
10:03:25 AM:     to: '/images/skedge-icon-outline.svg',
10:03:25 AM:     conditions: { Cookie: [Array] },
10:03:25 AM:     status: 200
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/images/skedge-icon.svg',
10:03:25 AM:     to: '/images/skedge-icon.svg',
10:03:25 AM:     conditions: { Cookie: [Array] },
10:03:25 AM:     status: 200
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/images/skedge-loading.json',
10:03:25 AM:     to: '/images/skedge-loading.json',
10:03:25 AM:     conditions: { Cookie: [Array] },
10:03:25 AM:     status: 200
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/images/skedge-logo-outline.svg',
10:03:25 AM:     to: '/images/skedge-logo-outline.svg',
10:03:25 AM:     conditions: { Cookie: [Array] },
10:03:25 AM:     status: 200
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/images/skedge-logo.svg',
10:03:25 AM:     to: '/images/skedge-logo.svg',
10:03:25 AM:     conditions: { Cookie: [Array] },
10:03:25 AM:     status: 200
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/images/skedge-oops.json',
10:03:25 AM:     to: '/images/skedge-oops.json',
10:03:25 AM:     conditions: { Cookie: [Array] },
10:03:25 AM:     status: 200
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/images/skedge-raincloud.json',
10:03:25 AM:     to: '/images/skedge-raincloud.json',
10:03:25 AM:     conditions: { Cookie: [Array] },
10:03:25 AM:     status: 200
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/images/skedge-zap.json',
10:03:25 AM:     to: '/images/skedge-zap.json',
10:03:25 AM:     conditions: { Cookie: [Array] },
10:03:25 AM:     status: 200
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/images/star.svg',
10:03:25 AM:     to: '/images/star.svg',
10:03:25 AM:     conditions: { Cookie: [Array] },
10:03:25 AM:     status: 200
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/*',
10:03:25 AM:     to: '/.netlify/functions/___netlify-handler',
10:03:25 AM:     status: 200,
10:03:25 AM:     conditions: { Cookie: [Array] },
10:03:25 AM:     force: true
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/_next/data/In8PSzV3MRFY9rfUsElxb/index.json',
10:03:25 AM:     to: '/.netlify/functions/___netlify-handler',
10:03:25 AM:     status: 200,
10:03:25 AM:     force: false
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/',
10:03:25 AM:     to: '/.netlify/functions/___netlify-handler',
10:03:25 AM:     status: 200,
10:03:25 AM:     force: false
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/_next/data/In8PSzV3MRFY9rfUsElxb/create.json',
10:03:25 AM:     to: '/.netlify/functions/___netlify-handler',
10:03:25 AM:     status: 200,
10:03:25 AM:     force: false
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/create',
10:03:25 AM:     to: '/.netlify/functions/___netlify-handler',
10:03:25 AM:     status: 200,
10:03:25 AM:     force: false
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/_next/data/In8PSzV3MRFY9rfUsElxb/learn.json',
10:03:25 AM:     to: '/.netlify/functions/___netlify-handler',
10:03:25 AM:     status: 200,
10:03:25 AM:     force: false
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/learn',
10:03:25 AM:     to: '/.netlify/functions/___netlify-handler',
10:03:25 AM:     status: 200,
10:03:25 AM:     force: false
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/_next/data/In8PSzV3MRFY9rfUsElxb/testing/create-fail.json',
10:03:25 AM:     to: '/.netlify/functions/___netlify-handler',
10:03:25 AM:     status: 200,
10:03:25 AM:     force: false
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/testing/create-fail',
10:03:25 AM:     to: '/.netlify/functions/___netlify-handler',
10:03:25 AM:     status: 200,
10:03:25 AM:     force: false
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/_next/data/In8PSzV3MRFY9rfUsElxb/testing/create-pending.json',
10:03:25 AM:     to: '/.netlify/functions/___netlify-handler',
10:03:25 AM:     status: 200,
10:03:25 AM:     force: false
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/testing/create-pending',
10:03:25 AM:     to: '/.netlify/functions/___netlify-handler',
10:03:25 AM:     status: 200,
10:03:25 AM:     force: false
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/_next/data/In8PSzV3MRFY9rfUsElxb/testing/event-fail.json',
10:03:25 AM:     to: '/.netlify/functions/___netlify-handler',
10:03:25 AM:     status: 200,
10:03:25 AM:     force: false
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/testing/event-fail',
10:03:25 AM:     to: '/.netlify/functions/___netlify-handler',
10:03:25 AM:     status: 200,
10:03:25 AM:     force: false
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/_next/data/In8PSzV3MRFY9rfUsElxb/testing/event-loading.json',
10:03:25 AM:     to: '/.netlify/functions/___netlify-handler',
10:03:25 AM:     status: 200,
10:03:25 AM:     force: false
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/testing/event-loading',
10:03:25 AM:     to: '/.netlify/functions/___netlify-handler',
10:03:25 AM:     status: 200,
10:03:25 AM:     force: false
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/_next/data/In8PSzV3MRFY9rfUsElxb/event/:eventId.json',
10:03:25 AM:     to: '/.netlify/functions/___netlify-handler',
10:03:25 AM:     status: 200,
10:03:25 AM:     force: false
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/event/:eventId',
10:03:25 AM:     to: '/.netlify/functions/___netlify-handler',
10:03:25 AM:     status: 200,
10:03:25 AM:     force: false
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/_next/data/In8PSzV3MRFY9rfUsElxb/event/:eventId/:userId.json',
10:03:25 AM:     to: '/.netlify/functions/___netlify-handler',
10:03:25 AM:     status: 200,
10:03:25 AM:     force: false
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/event/:eventId/:userId',
10:03:25 AM:     to: '/.netlify/functions/___netlify-handler',
10:03:25 AM:     status: 200,
10:03:25 AM:     force: false
10:03:25 AM:   },
10:03:25 AM:   {
10:03:25 AM:     from: '/*',
10:03:25 AM:     to: '/.netlify/functions/___netlify-handler',
10:03:25 AM:     status: 200
10:03:25 AM:   }
10:03:25 AM: ].
10:03:25 AM: ​
10:03:25 AM: (@netlify/plugin-nextjs onBuild completed in 123ms)
10:03:25 AM: ​
10:03:25 AM: Functions bundling                                            
10:03:25 AM: ────────────────────────────────────────────────────────────────
10:03:25 AM: ​
10:03:25 AM: Packaging Functions from .netlify/functions-internal directory:
10:03:25 AM:  - ___netlify-handler/___netlify-handler.js
10:03:25 AM:  - ___netlify-odb-handler/___netlify-odb-handler.js
10:03:25 AM:  - _ipx/_ipx.js
10:03:25 AM: ​
10:03:54 AM: ​
10:03:54 AM: (Functions bundling completed in 28.9s)
10:03:54 AM: ​
10:03:54 AM: Edge Functions bundling                                       
10:03:54 AM: ────────────────────────────────────────────────────────────────
10:03:54 AM: ​
10:03:54 AM: ​
10:03:54 AM: (Edge Functions bundling completed in 551ms)
10:03:54 AM: ​
10:03:54 AM: @netlify/plugin-nextjs (onPostBuild event)                    
10:03:54 AM: ────────────────────────────────────────────────────────────────
10:03:54 AM: ​
10:03:54 AM: Next.js cache saved.
10:03:54 AM: 🧪 Thank you for testing "appDir" support on Netlify. For known issues and to give feedback, visit https://ntl.fyi/next-13-feedback
10:03:54 AM: ​
10:03:54 AM: (@netlify/plugin-nextjs onPostBuild completed in 102ms)
10:03:54 AM: ​
10:03:54 AM: Deploy site                                                   
10:03:54 AM: ────────────────────────────────────────────────────────────────
10:03:54 AM: ​
10:03:54 AM: Starting to deploy site from '.next'
10:03:54 AM: Calculating files to upload
10:03:56 AM: 38 new files to upload
10:03:56 AM: 2 new functions to upload
10:04:04 AM: Section completed: deploying
10:04:04 AM: Site deploy was successfully initiated
10:04:04 AM: ​
10:04:04 AM: Starting post processing
10:04:04 AM: (Deploy site completed in 9.2s)
10:04:04 AM: ​
10:04:04 AM: Netlify Build Complete                                        
10:04:04 AM: ────────────────────────────────────────────────────────────────
10:04:04 AM: ​
10:04:04 AM: Skipping HTML post processing
10:04:04 AM: (Netlify Build completed in 48.5s)
10:04:04 AM: Post processing - header rules
10:04:04 AM: Post processing - redirect rules
10:04:04 AM: Caching artifacts
10:04:04 AM: Started saving node modules
10:04:04 AM: Finished saving node modules
10:04:04 AM: Post processing done
10:04:04 AM: Started saving build plugins
10:04:04 AM: Finished saving build plugins
10:04:04 AM: Started saving corepack cache
10:04:04 AM: Section completed: postprocessing
10:04:04 AM: Finished saving corepack cache
10:04:04 AM: Started saving pip cache
10:04:04 AM: Finished saving pip cache
10:04:04 AM: Started saving emacs cask dependencies
10:04:04 AM: Finished saving emacs cask dependencies
10:04:04 AM: Started saving maven dependencies
10:04:04 AM: Finished saving maven dependencies
10:04:04 AM: Started saving boot dependencies
10:04:04 AM: Finished saving boot dependencies
10:04:04 AM: Started saving rust rustup cache
10:04:04 AM: Finished saving rust rustup cache
10:04:04 AM: Started saving go dependencies
10:04:04 AM: Finished saving go dependencies
10:04:04 AM: Build script success
10:04:04 AM: Section completed: building
10:04:05 AM: Site is live ✨
10:04:06 AM: Uploading Cache of size 217.5MB
10:04:08 AM: Section completed: cleanup
10:04:08 AM: Finished processing build request in 1m10.651s

Here are all of the symptoms I’m experiencing:

  • All requests to one of my API endpoints are failing with a 500 “Internal Server Error” response.
  • This is only affecting one endpoint.
  • This only affects my production environment, the problem does not replicate in localhost testing.
  • I have re-deployed my last known-good commit, and that works. However, ALL commits made following that commit are failing in this way.
  • I tried reverting my codebase to the state of the known-good commit, and pushing a trivial change. I am getting the same failure even when my changes consist only of trivial CSS updates.

Why is one (just one it seems) of my endpoints broken in NextJS/Netlify, where there are NO code or infrastructure changes reflected in the diff?

I just tried your latest deploy and only /api/create, but I found this error in your function console:

Based on the stacktrace, something could be up with your create.js file.

@hrishikesh maybe you can help by describing:

  • what you did differently than what the Netlify deploy process does
  • what you did differently than what I do (simply run npm start)

I do not see the error you shared. It is not in my build logs:

deploy success

It also:

  • does not appear in my browser console
  • does not appear reported on the console by my linter as a TypeScript or other type error
  • does not appear reported in the IDE as a type error

I see the expires property being correctly populated in my DynamoDB instance, implying that this error is being shown falsely. The expires property is being created successfully both in local testing and in production and being propagated to the data store. Interestingly, the line of code called out in this stack trace doesn’t exist in my code base, the file isn’t even as long as the line number indicated.

Worked this issue for several days and later found a fix. My best guess is that Netlify released breaking changes to the platform’s NextJS support. In my package.json I had set my Netlify NextJS plugin dependency like so:

"@netlify/plugin-nextjs": "^4.36.0"

At the time I was receiving my error, @netlify/plugin-nextjs was available as version 4.37.1. When parsing my package.json file, Netlify was not pulling the more recent 4.37.1 when building, and instead seems to have been restricting itself to the 4.36.0 version in the package.json file, despite the caret ^ indicating that the most recent minor and patch versions should be pulled. By my understanding of semver rules, this indicates a major bug in Netlify’s deploy pipeline.

My solution was to push up a commit that specified ^4.37.1 instead of ^4.36.0, and this finally fixed my issue (logs and commit history will verify).

Missing a semver hit is egregious in my opinion, if this had been a significant production project that had bled hourly revenue I imagine this would be a different conversation.