500 Internal Server Error when using SEO component and getStaticProps

Netlify site name: https://webboltco.netlify.app/ (though I am working off a PR at the moment)

NextJS

The issue seems to be with getStaticProps and my SEO component. If I have getStaticProps on my page (even with dummy content), and I also have my SEO component on the page, I get 500 error on that page in production. If I remove the SEO component, no issue.

I have also tried stripping down the SEO component to only this:

import React from 'react'
import Head from 'next/head'

const SEO = () => {
  return (
    <Head>
      <meta property="og:type" content="website" />
    </Head>
  )
}

export default SEO

But if I include <SEO /> on any page that also has getStaticProps of any kind, 500 Internal Error. Only on production.

Nothing in the logs, either.

Build log

8:21:07 AM: Netlify Build                                                 
8:21:07 AM: ────────────────────────────────────────────────────────────────
8:21:07 AM: ​
8:21:07 AM: ❯ Version
8:21:07 AM:   @netlify/build 29.25.0
8:21:07 AM: ​
8:21:07 AM: ❯ Flags
8:21:07 AM:   baseRelDir: true
8:21:07 AM:   buildId: 654a39a1314626000864aa9c
8:21:07 AM:   deployId: 654a39a1314626000864aa9e
8:21:07 AM: ​
8:21:07 AM: ❯ Current directory
8:21:07 AM:   /opt/build/repo
8:21:07 AM: ​
8:21:07 AM: ❯ Config file
8:21:07 AM:   No config file was defined: using default values.
8:21:07 AM: ​
8:21:07 AM: ❯ Context
8:21:07 AM:   deploy-preview
8:21:07 AM: ​
8:21:07 AM: ❯ Using Next.js Runtime - v4.41.1
8:21:07 AM: ​
8:21:07 AM: ❯ Loading plugins
8:21:07 AM:    - @netlify/plugin-lighthouse@5.0.0 from Netlify app
8:21:08 AM: ​
8:21:08 AM: @netlify/plugin-nextjs (onPreBuild event)                     
8:21:08 AM: ────────────────────────────────────────────────────────────────
8:21:08 AM: ​
8:21:08 AM: Next.js cache restored.
8:21:08 AM: Netlify configuration property "build.environment.NEXT_PRIVATE_TARGET" value changed.
8:21:08 AM: ​
8:21:08 AM: (@netlify/plugin-nextjs onPreBuild completed in 122ms)
8:21:08 AM: ​
8:21:08 AM: Build command from Netlify app                                
8:21:08 AM: ────────────────────────────────────────────────────────────────
8:21:08 AM: ​
8:21:08 AM: $ npm run build
8:21:09 AM: > webbolt@0.1.0 build
8:21:09 AM: > next build
8:21:09 AM:    Linting and checking validity of types ...
8:21:10 AM: ./src/pages/success.tsx
8:21:10 AM: 96:13  Warning: Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element  @next/next/no-img-element
8:21:10 AM: info  - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
8:21:11 AM:    Creating an optimized production build ...
8:21:13 AM:  ✓ Compiled successfully
8:21:13 AM:    Collecting page data ...
8:21:15 AM:    Generating static pages (0/8) ...
8:21:16 AM:    Generating static pages (2/8)
8:21:16 AM:    Generating static pages (4/8)
8:21:17 AM:    Generating static pages (6/8)
8:21:19 AM:  ✓ Generating static pages (8/8)
8:21:21 AM:    Finalizing page optimization ...
8:21:21 AM:    Collecting build traces ...
8:21:22 AM: Route (pages)                                                              Size     First Load JS
8:21:22 AM: ┌ ● / (ISR: 60 Seconds) (1326 ms)                                          7.64 kB         139 kB
8:21:22 AM: ├   /_app                                                                  0 B             132 kB
8:21:22 AM: ├ ○ /404                                                                   182 B           132 kB
8:21:22 AM: ├ λ /api/hello                                                             0 B             132 kB
8:21:22 AM: ├ ● /blog (ISR: 60 Seconds) (972 ms)                                       1.25 kB         133 kB
8:21:22 AM: ├ ● /blog/[slug] (ISR: 60 Seconds) (5887 ms)                               35.7 kB         167 kB
8:21:22 AM: ├   ├ /blog/3-reasons-your-website-isnt-generating-leads-1-of-4 (2946 ms)
8:21:22 AM: ├   └ /blog/3-reasons-your-website-isnt-generating-leads-2-of-4 (2941 ms)
8:21:22 AM: ├ ○ /meeting (819 ms)                                                      1.58 kB         133 kB
8:21:22 AM: └ ○ /success (756 ms)                                                      1.56 kB         133 kB
8:21:22 AM: + First Load JS shared by all                                              136 kB
8:21:22 AM:   ├ chunks/framework-0c7baedefba6b077.js                                   45.3 kB
8:21:22 AM:   ├ chunks/main-7af7d5359a6145de.js                                        32.8 kB
8:21:22 AM:   ├ chunks/pages/_app-9beab24403b2b0aa.js                                  52.7 kB
8:21:22 AM:   ├ chunks/webpack-fa99431b15635937.js                                     836 B
8:21:22 AM:   └ css/743e3abaa4c69a85.css                                               4.71 kB
8:21:22 AM: λ  (Server)  server-side renders at runtime (uses getInitialProps or getServerSideProps)
8:21:22 AM: ○  (Static)  automatically rendered as static HTML (uses no initial props)
8:21:22 AM: ●  (SSG)     automatically generated as static HTML + JSON (uses getStaticProps)
8:21:22 AM:    (ISR)     incremental static regeneration (uses revalidate in getStaticProps)
8:21:22 AM: ​
8:21:22 AM: (build.command completed in 14.1s)
8:21:22 AM: ​
8:21:22 AM: @netlify/plugin-nextjs (onBuild event)                        
8:21:22 AM: ────────────────────────────────────────────────────────────────
8:21:22 AM: ​
8:21:23 AM: Moving static page files to serve from CDN...
8:21:23 AM: Moved 4 files to CDN
8:21:23 AM: Using Netlify Edge Functions for image format detection. Set env var "NEXT_DISABLE_EDGE_IMAGES=true" to disable.
8:21:23 AM: ✨ Deploying middleware and functions to Netlify Edge Functions ✨
8:21:23 AM: Netlify configuration property "redirects" value changed to [
8:21:23 AM:   { from: "/_next/static/*", to: "/static/:splat", status: 200 },
8:21:23 AM:   {
8:21:23 AM:     from: "/_next/image*",
8:21:23 AM:     query: { url: ":url", w: ":width", q: ":quality" },
8:21:23 AM:     to: "/_ipx/w_:width,q_:quality/:url",
8:21:23 AM:     status: 301
8:21:23 AM:   },
8:21:23 AM:   { from: "/_ipx/*", to: "/.netlify/builders/_ipx", status: 200 },
8:21:23 AM:   {
8:21:23 AM:     from: "/api/*",
8:21:23 AM:     to: "/.netlify/functions/___netlify-handler",
8:21:23 AM:     status: 200
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/canada1carsales.ca.png",
8:21:23 AM:     to: "/canada1carsales.ca.png",
8:21:23 AM:     conditions: { Cookie: [Array] },
8:21:23 AM:     status: 200
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/canada1carsales.ca_logo.svg",
8:21:23 AM:     to: "/canada1carsales.ca_logo.svg",
8:21:23 AM:     conditions: { Cookie: [Array] },
8:21:23 AM:     status: 200
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/darren.png",
8:21:23 AM:     to: "/darren.png",
8:21:23 AM:     conditions: { Cookie: [Array] },
8:21:23 AM:     status: 200
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/david.png",
8:21:23 AM:     to: "/david.png",
8:21:23 AM:     conditions: { Cookie: [Array] },
8:21:23 AM:     status: 200
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/favicon-16x16.png",
8:21:23 AM:     to: "/favicon-16x16.png",
8:21:23 AM:     conditions: { Cookie: [Array] },
8:21:23 AM:     status: 200
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/favicon-32x32.png",
8:21:23 AM:     to: "/favicon-32x32.png",
8:21:23 AM:     conditions: { Cookie: [Array] },
8:21:23 AM:     status: 200
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/favicon.ico",
8:21:23 AM:     to: "/favicon.ico",
8:21:23 AM:     conditions: { Cookie: [Array] },
8:21:23 AM:     status: 200
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/frustrated-customer.png",
8:21:23 AM:     to: "/frustrated-customer.png",
8:21:23 AM:     conditions: { Cookie: [Array] },
8:21:23 AM:     status: 200
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/gobetterway.ca_logo.svg",
8:21:23 AM:     to: "/gobetterway.ca_logo.svg",
8:21:23 AM:     conditions: { Cookie: [Array] },
8:21:23 AM:     status: 200
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/gobetterway.png",
8:21:23 AM:     to: "/gobetterway.png",
8:21:23 AM:     conditions: { Cookie: [Array] },
8:21:23 AM:     status: 200
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/happy-customer.png",
8:21:23 AM:     to: "/happy-customer.png",
8:21:23 AM:     conditions: { Cookie: [Array] },
8:21:23 AM:     status: 200
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/hero.png",
8:21:23 AM:     to: "/hero.png",
8:21:23 AM:     conditions: { Cookie: [Array] },
8:21:23 AM:     status: 200
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/michael.png",
8:21:23 AM:     to: "/michael.png",
8:21:23 AM:     conditions: { Cookie: [Array] },
8:21:23 AM:     status: 200
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/next.svg",
8:21:23 AM:     to: "/next.svg",
8:21:23 AM:     conditions: { Cookie: [Array] },
8:21:23 AM:     status: 200
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/nice.gif",
8:21:23 AM:     to: "/nice.gif",
8:21:23 AM:     conditions: { Cookie: [Array] },
8:21:23 AM:     status: 200
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/pdf_ipad.png",
8:21:23 AM:     to: "/pdf_ipad.png",
8:21:23 AM:     conditions: { Cookie: [Array] },
8:21:23 AM:     status: 200
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/pdf_ipad_noshadow.png",
8:21:23 AM:     to: "/pdf_ipad_noshadow.png",
8:21:23 AM:     conditions: { Cookie: [Array] },
8:21:23 AM:     status: 200
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/vercel.svg",
8:21:23 AM:     to: "/vercel.svg",
8:21:23 AM:     conditions: { Cookie: [Array] },
8:21:23 AM:     status: 200
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/webbolt-logo_white.svg",
8:21:23 AM:     to: "/webbolt-logo_white.svg",
8:21:23 AM:     conditions: { Cookie: [Array] },
8:21:23 AM:     status: 200
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/webbolt_logo.svg",
8:21:23 AM:     to: "/webbolt_logo.svg",
8:21:23 AM:     conditions: { Cookie: [Array] },
8:21:23 AM:     status: 200
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/blog/3-reasons-your-website-isnt-generating-leads-1-of-4.png",
8:21:23 AM:     to: "/blog/3-reasons-your-website-isnt-generating-leads-1-of-4.png",
8:21:23 AM:     conditions: { Cookie: [Array] },
8:21:23 AM:     status: 200
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/blog/3-reasons-your-website-isnt-generating-leads-2-of-4.png",
8:21:23 AM:     to: "/blog/3-reasons-your-website-isnt-generating-leads-2-of-4.png",
8:21:23 AM:     conditions: { Cookie: [Array] },
8:21:23 AM:     status: 200
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/blog/3-reasons-your-website-isnt-generating-leads-3-of-4.png",
8:21:23 AM:     to: "/blog/3-reasons-your-website-isnt-generating-leads-3-of-4.png",
8:21:23 AM:     conditions: { Cookie: [Array] },
8:21:23 AM:     status: 200
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/blog/3-reasons-your-website-isnt-generating-leads-4-of-4.png",
8:21:23 AM:     to: "/blog/3-reasons-your-website-isnt-generating-leads-4-of-4.png",
8:21:23 AM:     conditions: { Cookie: [Array] },
8:21:23 AM:     status: 200
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/blog/3-reasons-your-website-isnt-generating-leads.png",
8:21:23 AM:     to: "/blog/3-reasons-your-website-isnt-generating-leads.png",
8:21:23 AM:     conditions: { Cookie: [Array] },
8:21:23 AM:     status: 200
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/*",
8:21:23 AM:     to: "/.netlify/functions/___netlify-handler",
8:21:23 AM:     status: 200,
8:21:23 AM:     conditions: { Cookie: [Array] },
8:21:23 AM:     force: true
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/_next/data/0oH6lltPfTqZ74X3xHSoc/index.json",
8:21:23 AM:     to: "/.netlify/builders/___netlify-odb-handler",
8:21:23 AM:     status: 200,
8:21:23 AM:     force: true
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/",
8:21:23 AM:     to: "/.netlify/builders/___netlify-odb-handler",
8:21:23 AM:     status: 200,
8:21:23 AM:     force: true
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/_next/data/0oH6lltPfTqZ74X3xHSoc/blog.json",
8:21:23 AM:     to: "/.netlify/builders/___netlify-odb-handler",
8:21:23 AM:     status: 200,
8:21:23 AM:     force: true
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/blog",
8:21:23 AM:     to: "/.netlify/builders/___netlify-odb-handler",
8:21:23 AM:     status: 200,
8:21:23 AM:     force: true
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/_next/data/0oH6lltPfTqZ74X3xHSoc/blog/3-reasons-your-website-isnt-generating-leads-2-of-4.json",
8:21:23 AM:     to: "/.netlify/builders/___netlify-odb-handler",
8:21:23 AM:     status: 200,
8:21:23 AM:     force: true
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/blog/3-reasons-your-website-isnt-generating-leads-2-of-4",
8:21:23 AM:     to: "/.netlify/builders/___netlify-odb-handler",
8:21:23 AM:     status: 200,
8:21:23 AM:     force: true
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/_next/data/0oH6lltPfTqZ74X3xHSoc/blog/3-reasons-your-website-isnt-generating-leads-1-of-4.json",
8:21:23 AM:     to: "/.netlify/builders/___netlify-odb-handler",
8:21:23 AM:     status: 200,
8:21:23 AM:     force: true
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/blog/3-reasons-your-website-isnt-generating-leads-1-of-4",
8:21:23 AM:     to: "/.netlify/builders/___netlify-odb-handler",
8:21:23 AM:     status: 200,
8:21:23 AM:     force: true
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/_next/data/0oH6lltPfTqZ74X3xHSoc/meeting.json",
8:21:23 AM:     to: "/.netlify/functions/___netlify-handler",
8:21:23 AM:     status: 200,
8:21:23 AM:     force: false
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/meeting",
8:21:23 AM:     to: "/.netlify/functions/___netlify-handler",
8:21:23 AM:     status: 200,
8:21:23 AM:     force: false
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/_next/data/0oH6lltPfTqZ74X3xHSoc/success.json",
8:21:23 AM:     to: "/.netlify/functions/___netlify-handler",
8:21:23 AM:     status: 200,
8:21:23 AM:     force: false
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/success",
8:21:23 AM:     to: "/.netlify/functions/___netlify-handler",
8:21:23 AM:     status: 200,
8:21:23 AM:     force: false
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/_next/data/0oH6lltPfTqZ74X3xHSoc/blog/:slug.json",
8:21:23 AM:     to: "/.netlify/builders/___netlify-odb-handler",
8:21:23 AM:     status: 200,
8:21:23 AM:     force: false
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/blog/:slug",
8:21:23 AM:     to: "/.netlify/builders/___netlify-odb-handler",
8:21:23 AM:     status: 200,
8:21:23 AM:     force: false
8:21:23 AM:   },
8:21:23 AM:   {
8:21:23 AM:     from: "/*",
8:21:23 AM:     to: "/.netlify/functions/___netlify-handler",
8:21:23 AM:     status: 200
8:21:23 AM:   }
8:21:23 AM: ].
8:21:23 AM: ​
8:21:23 AM: (@netlify/plugin-nextjs onBuild completed in 247ms)
8:21:23 AM: ​
8:21:23 AM: Functions bundling                                            
8:21:23 AM: ────────────────────────────────────────────────────────────────
8:21:23 AM: ​
8:21:23 AM: Packaging Functions from .netlify/functions-internal directory:
8:21:23 AM:  - ___netlify-handler/___netlify-handler.js
8:21:23 AM:  - ___netlify-odb-handler/___netlify-odb-handler.js
8:21:23 AM:  - _ipx/_ipx.js
8:21:23 AM: ​
8:21:42 AM: ​
8:21:42 AM: (Functions bundling completed in 19s)
8:21:42 AM: ​
8:21:42 AM: Edge Functions bundling                                       
8:21:42 AM: ────────────────────────────────────────────────────────────────
8:21:42 AM: ​
8:21:42 AM: Packaging Edge Functions from .netlify/edge-functions directory:
8:21:42 AM:  - ipx
8:21:42 AM: ​
8:21:42 AM: (Edge Functions bundling completed in 385ms)
8:21:42 AM: ​
8:21:42 AM: @netlify/plugin-nextjs (onPostBuild event)                    
8:21:42 AM: ────────────────────────────────────────────────────────────────
8:21:42 AM: ​
8:21:42 AM: Next.js cache saved.
8:21:42 AM: ​
8:21:42 AM: (@netlify/plugin-nextjs onPostBuild completed in 93ms)
8:21:42 AM: ​
8:22:00 AM: (Netlify Build completed in 53.3s)
8:22:01 AM: Section completed: building
8:22:05 AM: Finished processing build request in 1m17.489s

FYI, Here’s the PR preview URL: https://deploy-preview-1--webboltco.netlify.app/

[Bug]: Error: Cannot find module 'next/dist/server/future/route-modules/pages/vendored/contexts/amp-context' in NextJS preview mode · Issue #2329 · netlify/next-runtime (github.com)

from: Function details | Functions | Logs | webboltco | Netlify