From c2d054e7051a7967acb050420a8d049e509b4350 Mon Sep 17 00:00:00 2001 From: FalahMobile Date: Fri, 3 Jul 2026 11:22:38 +0800 Subject: [PATCH] fix: add --webpack flag for Next.js 16 Turbopack compatibility - serwist/next requires webpack, Next.js 16 defaults to Turbopack - dev/build scripts now use --webpack flag - Disable serwist in dev mode to avoid warnings --- next-env.d.ts | 2 +- next.config.ts | 1 + package.json | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/next-env.d.ts b/next-env.d.ts index 9edff1c..c4b7818 100644 --- a/next-env.d.ts +++ b/next-env.d.ts @@ -1,6 +1,6 @@ /// /// -import "./.next/types/routes.d.ts"; +import "./.next/dev/types/routes.d.ts"; // NOTE: This file should not be edited // see https://nextjs.org/docs/app/api-reference/config/typescript for more information. diff --git a/next.config.ts b/next.config.ts index 578372d..008b15b 100644 --- a/next.config.ts +++ b/next.config.ts @@ -4,6 +4,7 @@ import withSerwistInit from '@serwist/next' const withSerwist = withSerwistInit({ swSrc: 'src/sw.ts', swDest: 'public/sw.js', + disable: process.env.NODE_ENV === 'development', }) const nextConfig: NextConfig = { diff --git a/package.json b/package.json index 20dc290..a93821d 100644 --- a/package.json +++ b/package.json @@ -3,8 +3,8 @@ "version": "0.1.0", "private": true, "scripts": { - "dev": "next dev", - "build": "next build", + "dev": "next dev --webpack", + "build": "next build --webpack", "start": "next start", "lint": "eslint" },