Published to github and deployed it to netlify, but got 500 error.

Hi, I am new to plasmic, I created a new project from a template and published it to my github with nextjs, then I deployed it to netlify and the building was successful, but I got a 500 error when accessing the website.
like this https://eclectic-moxie-d90234.netlify.app/
I chose several templates like this, even the basic website starter template.
The template remains unchanged and the options for deploying to netlify are all default (It is automatically recognized as next.js).
Did I miss something?

Hi, thanks for reporting. We’re having trouble reproducing this.

Can you share:

  • Is it only on Netlify? Does it also have an issue if you try Vercel?
  • Do you have a link to your Github repo?
  • Would you mind also trying to create the repo with just create-plasmic-app on the command line?

Thanks for your reply, very happy to share it.
my repo:

I also deployed it on vercel and there was no problem.
I just used the create-plasmic-app command line to create a project, and I still get a 500 error on netlify.

Can you share from the Netlify logs what exactly the error is?

Yes, Of course.
Building is complete.

12:51:56 PM: build-image version: 50f2c07b4ff67fac131b5b345ef7efb7e0ab9dac (focal)
12:51:56 PM: buildbot version: 3c77419a32191e587913c896861b4b2804c7fa10
12:51:56 PM: Fetching cached dependencies
12:51:56 PM: Failed to fetch cache, continuing with build
12:51:56 PM: Starting to prepare the repo for build
12:51:56 PM: No cached dependencies found. Cloning fresh repo
12:51:56 PM: git clone --filter=blob:none https://github.com/taoguangc/plasmic-starter
12:51:56 PM: Preparing Git Reference refs/heads/main
12:51:58 PM: Starting to install dependencies
12:51:58 PM: Python version set to 3.8
12:51:58 PM: Attempting Ruby version 2.7.2, read from environment
12:51:58 PM: Using Ruby version 2.7.2
12:51:59 PM: Started restoring cached go cache
12:51:59 PM: Finished restoring cached go cache
12:51:59 PM: go version go1.19.13 linux/amd64
12:51:59 PM: Using PHP version 8.0
12:52:00 PM: v18.18.2 is already installed.
12:52:00 PM: Now using node v18.18.2 (npm v9.8.1)
12:52:01 PM: Enabling Node.js Corepack
12:52:01 PM: Started restoring cached build plugins
12:52:01 PM: Finished restoring cached build plugins
12:52:01 PM: Started restoring cached corepack dependencies
12:52:01 PM: Finished restoring cached corepack dependencies
12:52:01 PM: No npm workspaces detected
12:52:01 PM: Started restoring cached node modules
12:52:01 PM: Finished restoring cached node modules
12:52:01 PM: Installing npm packages using npm version 9.8.1
12:52:07 PM: added 309 packages, and audited 310 packages in 6s
12:52:07 PM: 106 packages are looking for funding
12:52:07 PM:   run `npm fund` for details
12:52:07 PM: found 0 vulnerabilities
12:52:07 PM: npm packages installed
12:52:07 PM: Install dependencies script success
12:52:07 PM: Starting build script
12:52:08 PM: Detected 1 framework(s)
12:52:08 PM: "next" at version "14.0.0"
12:52:08 PM: Section completed: initializing
12:52:10 PM: ​
12:52:10 PM: Netlify Build                                                 
12:52:10 PM: ────────────────────────────────────────────────────────────────
12:52:10 PM: ​
12:52:10 PM: ❯ Version
12:52:10 PM:   @netlify/build 29.24.0
12:52:10 PM: ​
12:52:10 PM: ❯ Flags
12:52:10 PM:   baseRelDir: true
12:52:10 PM:   buildId: 653f366b2f37241172657dd4
12:52:10 PM:   deployId: 653f366b2f37241172657dd6
12:52:10 PM: ​
12:52:10 PM: ❯ Current directory
12:52:10 PM:   /opt/build/repo
12:52:10 PM: ​
12:52:10 PM: ❯ Config file
12:52:10 PM:   No config file was defined: using default values.
12:52:10 PM: ​
12:52:10 PM: ❯ Context
12:52:10 PM:   production
12:52:10 PM: ​
12:52:10 PM: ❯ Installing plugins
12:52:10 PM:    - @netlify/plugin-nextjs@4.41.1
12:52:23 PM: ​
12:52:23 PM: ❯ Using Next.js Runtime - v4.41.1
12:52:24 PM: ​
12:52:24 PM: @netlify/plugin-nextjs (onPreBuild event)                     
12:52:24 PM: ────────────────────────────────────────────────────────────────
12:52:24 PM: ​
12:52:24 PM: No Next.js cache to restore.
12:52:24 PM: Netlify configuration property "build.environment.NEXT_PRIVATE_TARGET" value changed.
12:52:24 PM: ​
12:52:24 PM: (@netlify/plugin-nextjs onPreBuild completed in 49ms)
12:52:24 PM: ​
12:52:24 PM: Build command from Netlify app                                
12:52:24 PM: ────────────────────────────────────────────────────────────────
12:52:24 PM: ​
12:52:24 PM: $ npm run build
12:52:24 PM: > tmp-cpa@0.1.0 build
12:52:24 PM: > next build
12:52:25 PM: ⚠ No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
12:52:25 PM:    Linting and checking validity of types ...
12:52:26 PM:    ▲ Next.js 14.0.0
12:52:26 PM:    Creating an optimized production build ...
12:52:28 PM:  ✓ Compiled successfully
12:52:28 PM:    Collecting page data ...
12:52:29 PM: Plasmic: doing a fresh fetch...
12:52:30 PM: Plasmic: fetched designs for "Website starter" (eS1CyonBnQCAZs3tyNsNJy@0.0.1)
12:52:30 PM:    Generating static pages (0/4) ...
12:52:31 PM:    Generating static pages (1/4)
12:52:31 PM:    Generating static pages (2/4)
12:52:31 PM: Plasmic: doing a fresh fetch...
12:52:31 PM:    Generating static pages (3/4)
12:52:31 PM: Plasmic: fetched designs for "Website starter" (eS1CyonBnQCAZs3tyNsNJy@0.0.1)
12:52:31 PM:  ✓ Generating static pages (4/4)
12:52:32 PM:    Finalizing page optimization ...
12:52:32 PM:    Collecting build traces ...
12:52:36 PM: Route (pages)                                    Size     First Load JS
12:52:36 PM: ┌ ● /[[...catchall]] (ISR: 60 Seconds) (346 ms)  659 B           133 kB
12:52:36 PM: ├   └ / (346 ms)
12:52:36 PM: ├ ○ /404                                         182 B           104 kB
12:52:36 PM: ├ λ /api/hello                                   0 B             104 kB
12:52:36 PM: └ ○ /plasmic-host                                442 B           133 kB
12:52:36 PM: + First Load JS shared by all                    104 kB
12:52:36 PM:   ├ chunks/framework-58f0be2d6f1dd525.js         67.4 kB
12:52:36 PM:   ├ chunks/main-ccb8a7a0c5e3016d.js              35.3 kB
12:52:36 PM:   ├ chunks/pages/_app-c54702eb327175a3.js        205 B
12:52:36 PM:   └ chunks/webpack-6af0e3c12b874bb0.js           1.02 kB
12:52:36 PM: ○  (Static)   prerendered as static HTML
12:52:36 PM: ●  (SSG)      prerendered as static HTML (uses getStaticProps)
12:52:36 PM:    (ISR)      incremental static regeneration (uses revalidate in getStaticProps)
12:52:36 PM: λ  (Dynamic)  server-rendered on demand using Node.js
12:52:36 PM: ​
12:52:36 PM: (build.command completed in 11.8s)
12:52:36 PM: ​
12:52:36 PM: @netlify/plugin-nextjs (onBuild event)                        
12:52:36 PM: ────────────────────────────────────────────────────────────────
12:52:36 PM: ​
12:52:36 PM: Moving static page files to serve from CDN...
12:52:36 PM: Moved 3 files to CDN
12:52:36 PM: You are not using Netlify Edge Functions for image format detection. Set env var "NEXT_FORCE_EDGE_IMAGES=true" to enable.
12:52:36 PM: Netlify configuration property "redirects" value changed to [
12:52:36 PM:   { from: "/_next/static/*", to: "/static/:splat", status: 200 },
12:52:36 PM:   {
12:52:36 PM:     from: "/_next/image*",
12:52:36 PM:     query: { url: ":url", w: ":width", q: ":quality" },
12:52:36 PM:     to: "/_ipx/w_:width,q_:quality/:url",
12:52:36 PM:     status: 301
12:52:36 PM:   },
12:52:36 PM:   { from: "/_ipx/*", to: "/.netlify/builders/_ipx", status: 200 },
12:52:36 PM:   {
12:52:36 PM:     from: "/api/*",
12:52:36 PM:     to: "/.netlify/functions/___netlify-handler",
12:52:36 PM:     status: 200
12:52:36 PM:   },
12:52:36 PM:   {
12:52:36 PM:     from: "/favicon.ico",
12:52:36 PM:     to: "/favicon.ico",
12:52:36 PM:     conditions: { Cookie: [Array] },
12:52:36 PM:     status: 200
12:52:36 PM:   },
12:52:36 PM:   {
12:52:36 PM:     from: "/next.svg",
12:52:36 PM:     to: "/next.svg",
12:52:36 PM:     conditions: { Cookie: [Array] },
12:52:36 PM:     status: 200
12:52:36 PM:   },
12:52:36 PM:   {
12:52:36 PM:     from: "/vercel.svg",
12:52:36 PM:     to: "/vercel.svg",
12:52:36 PM:     conditions: { Cookie: [Array] },
12:52:36 PM:     status: 200
12:52:36 PM:   },
12:52:36 PM:   {
12:52:36 PM:     from: "/*",
12:52:36 PM:     to: "/.netlify/functions/___netlify-handler",
12:52:36 PM:     status: 200,
12:52:36 PM:     conditions: { Cookie: [Array] },
12:52:36 PM:     force: true
12:52:36 PM:   },
12:52:36 PM:   {
12:52:36 PM:     from: "/_next/data/OnUQM4pq1mVEbj-e3zcRG/index.json",
12:52:36 PM:     to: "/.netlify/builders/___netlify-odb-handler",
12:52:36 PM:     status: 200,
12:52:36 PM:     force: true
12:52:36 PM:   },
12:52:36 PM:   {
12:52:36 PM:     from: "/",
12:52:36 PM:     to: "/.netlify/builders/___netlify-odb-handler",
12:52:36 PM:     status: 200,
12:52:36 PM:     force: true
12:52:36 PM:   },
12:52:36 PM:   {
12:52:36 PM:     from: "/_next/data/OnUQM4pq1mVEbj-e3zcRG/plasmic-host.json",
12:52:36 PM:     to: "/.netlify/functions/___netlify-handler",
12:52:36 PM:     status: 200,
12:52:36 PM:     force: false
12:52:36 PM:   },
12:52:36 PM:   {
12:52:36 PM:     from: "/plasmic-host",
12:52:36 PM:     to: "/.netlify/functions/___netlify-handler",
12:52:36 PM:     status: 200,
12:52:36 PM:     force: false
12:52:36 PM:   },
12:52:36 PM:   {
12:52:36 PM:     from: "/_next/data/OnUQM4pq1mVEbj-e3zcRG/index.json",
12:52:36 PM:     to: "/.netlify/builders/___netlify-odb-handler",
12:52:36 PM:     status: 200,
12:52:36 PM:     force: false
12:52:36 PM:   },
12:52:36 PM:   {
12:52:36 PM:     from: "/_next/data/OnUQM4pq1mVEbj-e3zcRG/*",
12:52:36 PM:     to: "/.netlify/builders/___netlify-odb-handler",
12:52:36 PM:     status: 200,
12:52:36 PM:     force: false
12:52:36 PM:   },
12:52:36 PM:   {
12:52:36 PM:     from: "/",
12:52:36 PM:     to: "/.netlify/builders/___netlify-odb-handler",
12:52:36 PM:     status: 200,
12:52:36 PM:     force: false
12:52:36 PM:   },
12:52:36 PM:   {
12:52:36 PM:     from: "/*",
12:52:36 PM:     to: "/.netlify/builders/___netlify-odb-handler",
12:52:36 PM:     status: 200,
12:52:36 PM:     force: false
12:52:36 PM:   },
12:52:36 PM:   {
12:52:36 PM:     from: "/*",
12:52:36 PM:     to: "/.netlify/functions/___netlify-handler",
12:52:36 PM:     status: 200
12:52:36 PM:   }
12:52:36 PM: ].
12:52:36 PM: ​
12:52:36 PM: (@netlify/plugin-nextjs onBuild completed in 212ms)
12:52:36 PM: ​
12:52:36 PM: Functions bundling                                            
12:52:36 PM: ────────────────────────────────────────────────────────────────
12:52:36 PM: ​
12:52:36 PM: Packaging Functions from .netlify/functions-internal directory:
12:52:36 PM:  - ___netlify-handler/___netlify-handler.js
12:52:36 PM:  - ___netlify-odb-handler/___netlify-odb-handler.js
12:52:36 PM:  - _ipx/_ipx.js
12:52:36 PM: ​
12:52:52 PM: ​
12:52:52 PM: (Functions bundling completed in 16.3s)
12:52:52 PM: ​
12:52:52 PM: Edge Functions bundling                                       
12:52:52 PM: ────────────────────────────────────────────────────────────────
12:52:52 PM: ​
12:52:53 PM: ​
12:52:53 PM: (Edge Functions bundling completed in 673ms)
12:52:53 PM: ​
12:52:53 PM: @netlify/plugin-nextjs (onPostBuild event)                    
12:52:53 PM: ────────────────────────────────────────────────────────────────
12:52:53 PM: ​
12:52:53 PM: Next.js cache saved.
12:52:53 PM: ​
12:52:53 PM: (@netlify/plugin-nextjs onPostBuild completed in 56ms)
12:52:53 PM: ​
12:52:53 PM: Deploy site                                                   
12:52:53 PM: ────────────────────────────────────────────────────────────────
12:52:53 PM: ​
12:52:53 PM: Starting to deploy site from ".next"
12:52:53 PM: Calculating files to upload
12:52:54 PM: 9 new files to upload
12:52:54 PM: 3 new functions to upload
12:53:01 PM: Starting post processing
12:53:01 PM: Post processing done
12:53:01 PM: Section completed: postprocessing
12:53:01 PM: Skipping HTML post processing
12:53:01 PM: Post processing - header rules
12:53:01 PM: Post processing - redirect rules
12:53:01 PM: Section completed: deploying
12:53:01 PM: Site deploy was successfully initiated
12:53:01 PM: ​
12:53:01 PM: (Deploy site completed in 7.6s)
12:53:01 PM: ​
12:53:01 PM: Netlify Build Complete                                        
12:53:01 PM: ────────────────────────────────────────────────────────────────
12:53:01 PM: ​
12:53:01 PM: (Netlify Build completed in 51.4s)
12:53:02 PM: Site is live ✨
12:53:02 PM: Caching artifacts
12:53:02 PM: Started saving node modules
12:53:02 PM: Finished saving node modules
12:53:02 PM: Started saving build plugins
12:53:02 PM: Finished saving build plugins
12:53:02 PM: Started saving corepack cache
12:53:02 PM: Finished saving corepack cache
12:53:02 PM: Started saving pip cache
12:53:02 PM: Finished saving pip cache
12:53:02 PM: Started saving emacs cask dependencies
12:53:02 PM: Finished saving emacs cask dependencies
12:53:02 PM: Started saving maven dependencies
12:53:02 PM: Finished saving maven dependencies
12:53:02 PM: Started saving boot dependencies
12:53:02 PM: Finished saving boot dependencies
12:53:02 PM: Started saving rust rustup cache
12:53:02 PM: Finished saving rust rustup cache
12:53:02 PM: Started saving go dependencies
12:53:02 PM: Finished saving go dependencies
12:53:02 PM: Build script success
12:53:02 PM: Section completed: building
12:53:03 PM: Uploading Cache of size 180.5MB
12:53:05 PM: Section completed: cleanup
12:53:05 PM: Finished processing build request in 1m8.966s

But it seems that there is no homepage in the generated file below

You can also publish to your github with any template and deploy to netlify, the same problem will reappear.

It seems that this problem is caused by netlify being incompatible with the nextjs version that is too high. I am still looking for a solution.

The current solution is to downgrade next.js to 13.4.x. Currently I downgrade to 13.4.19 and everything works fine!