Upgrade to Next.js 16, enable SSR, update packages

- Upgrade all packages to latest versions
- Enable SSR (dynamic = 'force-dynamic') for all pages
- Update PostCSS config for Tailwind CSS v4 (@tailwindcss/postcss)
- Fix Edge-compatible CSRF token generation (Web Crypto API)
- Remove deprecated eslint config from next.config.ts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-01 15:29:46 +01:00
co-authored by Claude Opus 4.5
parent cd58dc5259
commit 90df7bde9e
8 changed files with 2417 additions and 2322 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference path="./.next/types/routes.d.ts" />
import "./.next/types/routes.d.ts";
// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
+1 -4
View File
@@ -10,10 +10,7 @@ const nextConfig: NextConfig = {
// Enable React strict mode for better error detection
reactStrictMode: true,
// Temporarily ignore ESLint and TypeScript during build (pre-existing issues)
eslint: {
ignoreDuringBuilds: true,
},
// Temporarily ignore TypeScript during build (pre-existing issues)
typescript: {
ignoreBuildErrors: true,
},
+34 -33
View File
@@ -19,51 +19,52 @@
"test:coverage": "vitest run --coverage"
},
"dependencies": {
"@mdx-js/loader": "^3.1.0",
"@mdx-js/mdx": "^3.1.0",
"@mdx-js/react": "^3.1.0",
"@mdx-js/loader": "^3.1.1",
"@mdx-js/mdx": "^3.1.1",
"@mdx-js/react": "^3.1.1",
"@next-safe/middleware": "^0.10.0",
"@next/mdx": "^15.1.0",
"@next/mdx": "^16.1.6",
"@supabase/ssr": "^0.8.0",
"@supabase/supabase-js": "^2.39.7",
"@supabase/supabase-js": "^2.93.3",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"framer-motion": "^11.18.2",
"framer-motion": "^12.29.2",
"gray-matter": "^4.0.3",
"lucide-react": "^0.475.0",
"next": "^15.1.0",
"next-intl": "^3.26.0",
"lucide-react": "^0.563.0",
"next": "^16.1.6",
"next-intl": "^4.8.1",
"next-mdx-remote": "^5.0.0",
"openai": "^4.77.0",
"pg": "^8.13.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"openai": "^6.17.0",
"pg": "^8.18.0",
"react": "^19.2.4",
"react-dom": "^19.2.4",
"react-ga4": "^2.1.0",
"react-intersection-observer": "^9.8.1",
"tailwind-merge": "^3.0.1",
"react-intersection-observer": "^10.0.2",
"tailwind-merge": "^3.4.0",
"tailwindcss-animate": "^1.0.7",
"web-vitals": "^5.1.0"
},
"devDependencies": {
"@playwright/test": "^1.58.0",
"@tailwindcss/forms": "^0.5.7",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^14.0.0",
"@playwright/test": "^1.58.1",
"@tailwindcss/forms": "^0.5.11",
"@tailwindcss/postcss": "^4.1.18",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.2",
"@types/mdx": "^2.0.13",
"@types/node": "^22.0.0",
"@types/pg": "^8.11.10",
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0",
"@vitest/coverage-v8": "1.6.1",
"autoprefixer": "^10.4.18",
"eslint": "^9.9.1",
"eslint-config-next": "^15.1.0",
"jsdom": "^23.2.0",
"@types/node": "^25.1.0",
"@types/pg": "^8.16.0",
"@types/react": "^19.2.10",
"@types/react-dom": "^19.2.3",
"@vitest/coverage-v8": "4.0.18",
"autoprefixer": "^10.4.24",
"eslint": "^9.39.2",
"eslint-config-next": "^16.1.6",
"jsdom": "^27.4.0",
"playwright-lighthouse": "^4.0.0",
"postcss": "^8.4.35",
"sharp": "^0.34.3",
"tailwindcss": "^3.4.1",
"typescript": "^5.5.3",
"vitest": "^1.3.1"
"postcss": "^8.5.6",
"sharp": "^0.34.5",
"tailwindcss": "^4.1.18",
"typescript": "^5.9.3",
"vitest": "^4.0.18"
}
}
+2357 -2277
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,6 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
'@tailwindcss/postcss': {},
autoprefixer: {},
},
};
+4
View File
@@ -10,6 +10,10 @@ import { WebVitals } from '@/components/analytics';
import { ChatbotLoader } from '@/components/chat/ChatbotLoader';
import '../globals.css';
// Enable SSR - render pages on each request
export const dynamic = 'force-dynamic';
export const revalidate = 0;
const inter = Inter({
subsets: ['latin'],
display: 'swap',
+8 -2
View File
@@ -2,11 +2,17 @@ import { chain, chainMatch, isPageRequest, csp } from '@next-safe/middleware';
import { NextRequest, NextResponse } from 'next/server';
import createMiddleware from 'next-intl/middleware';
import { locales, defaultLocale } from './i18n/config';
import { randomBytes } from 'crypto';
const CSRF_TOKEN_COOKIE_NAME = 'csrf_token';
const CSRF_TOKEN_LENGTH = 32;
// Edge-compatible random bytes generation
function generateToken(length: number): string {
const bytes = new Uint8Array(length);
crypto.getRandomValues(bytes);
return btoa(String.fromCharCode(...bytes)).replace(/[+/=]/g, '');
}
const handleI18nRouting = createMiddleware({
locales,
defaultLocale,
@@ -33,7 +39,7 @@ function csrfMiddleware(request: NextRequest, response: NextResponse): NextRespo
const existingToken = request.cookies.get(CSRF_TOKEN_COOKIE_NAME);
if (!existingToken) {
const newToken = randomBytes(CSRF_TOKEN_LENGTH).toString('base64url');
const newToken = generateToken(CSRF_TOKEN_LENGTH);
response.cookies.set(CSRF_TOKEN_COOKIE_NAME, newToken, {
httpOnly: true,
+11 -4
View File
@@ -1,7 +1,11 @@
{
"compilerOptions": {
"target": "ES2017",
"lib": ["dom", "dom.iterable", "esnext"],
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
@@ -11,7 +15,7 @@
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"jsx": "react-jsx",
"incremental": true,
"plugins": [
{
@@ -19,14 +23,17 @@
}
],
"paths": {
"@/*": ["./src/*"]
"@/*": [
"./src/*"
]
}
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts"
".next/types/**/*.ts",
".next/dev/types/**/*.ts"
],
"exclude": [
"node_modules",