Skip to content

Commit fea7c02

Browse files
committed
fix: configure Netlify deployment for Next.js runtime
- Switch from static export to Netlify Next.js plugin - Update netlify.toml to use @netlify/plugin-nextjs - Remove static export config from next.config.js - Fix build publish directory to .next - This should resolve auto-deployment issues on Netlify
1 parent e77fa7f commit fea7c02

3 files changed

Lines changed: 6 additions & 7 deletions

File tree

netlify.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[build]
22
command = "npm run build"
3-
publish = "out"
3+
publish = ".next"
44

55
[build.environment]
66
NODE_VERSION = "18"
77

8-
[[redirects]]
9-
from = "/*"
10-
to = "/index.html"
11-
status = 200
8+
[[plugins]]
9+
package = "@netlify/plugin-nextjs"
10+
11+
# Redirects are handled by Next.js and the Netlify plugin
1212

1313
[[headers]]
1414
for = "/*"

next.config.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
/** @type {import('next').NextConfig} */
22
const nextConfig = {
3-
// Only use export for production builds
4-
...(process.env.NODE_ENV === "production" && { output: "export" }),
53
trailingSlash: true,
64
images: {
75
unoptimized: true,

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"scripts": {
66
"dev": "next dev",
77
"build": "next build",
8+
"export": "next export",
89
"start": "next start",
910
"lint": "next lint",
1011
"type-check": "tsc --noEmit"

0 commit comments

Comments
 (0)