Skip to content

Commit 3ec5929

Browse files
committed
fix(webapp): resolve static page generation build errors
- Add outputFileTracingRoot to fix monorepo lockfile detection - Add getServerSideProps to design-system pages (dev-only) - Add getServerSideProps to unsubscribe page (uses useRouter) - Prevents <Html> import errors during static page prerendering
1 parent a863c22 commit 3ec5929

4 files changed

Lines changed: 21 additions & 0 deletions

File tree

packages/webapp/next.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ module.exports = withPWA({
1818
// Production build optimization - standalone output for Docker
1919
output: 'standalone',
2020

21+
// Fix for monorepo with multiple lockfiles
22+
outputFileTracingRoot: path.join(__dirname, '../../'),
23+
2124
// Dev mode optimizations (faster compilation, especially in Docker)
2225
...(process.env.NODE_ENV === 'development' && {
2326
// Skip type checking during dev (Next.js handles it separately)

packages/webapp/src/pages/design-system-docs.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,11 @@
1010
*/
1111

1212
import { DesignSystemDocsPage } from '@components/pages/design-system-docs'
13+
import type { GetServerSideProps } from 'next'
14+
15+
// Disable static generation - this is a dev-only page
16+
export const getServerSideProps: GetServerSideProps = async () => {
17+
return { props: {} }
18+
}
1319

1420
export default DesignSystemDocsPage

packages/webapp/src/pages/design-system.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,11 @@
99
*/
1010

1111
import { DesignSystemPage } from '@components/pages/design-system'
12+
import type { GetServerSideProps } from 'next'
13+
14+
// Disable static generation - this is a dev-only page
15+
export const getServerSideProps: GetServerSideProps = async () => {
16+
return { props: {} }
17+
}
1218

1319
export default DesignSystemPage

packages/webapp/src/pages/unsubscribe.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,17 @@
1010
* 3. Shows confirmation with options to manage preferences
1111
*/
1212

13+
import type { GetServerSideProps } from 'next'
1314
import Head from 'next/head'
1415
import Link from 'next/link'
1516
import { useRouter } from 'next/router'
1617
import { useEffect, useState } from 'react'
1718

19+
// Disable static generation - this page uses useRouter
20+
export const getServerSideProps: GetServerSideProps = async () => {
21+
return { props: {} }
22+
}
23+
1824
interface UnsubscribeResult {
1925
success: boolean
2026
action?: string

0 commit comments

Comments
 (0)