build: migrate dev server to webpack

https://github.com/vercel/next.js/issues/78069
This commit is contained in:
nxtkofi 2026-03-28 11:21:58 +01:00
parent 41fb8bbb51
commit d41180b42b
4 changed files with 24 additions and 7 deletions

View file

@ -28,9 +28,12 @@ This is production ready setup for Convex and Next SaaS.
First, run the development server: First, run the development server:
```bash ```bash
pnpm dev pnpm dev --webpack
``` ```
> [!NOTE]
> As of Next.js@16.2.1 turbopack is broken ant it spikes CPU usage by 900% and 8-9GiB of RAM usage, thus why we use webpack. Wait for 16.3.0 to migrate to turbopack
### Convex ### Convex
[Source of truth](https://github.com/get-convex/convex-backend/blob/main/self-hosted/README.md) [Source of truth](https://github.com/get-convex/convex-backend/blob/main/self-hosted/README.md)

View file

@ -14,8 +14,8 @@ export default function RootLayout({
children: React.ReactNode; children: React.ReactNode;
}>) { }>) {
return ( return (
<html lang="en" className="h-full antialiased"> <html lang="en" className="h-full antialiased" suppressHydrationWarning>
<body className="min-h-full flex flex-col" suppressHydrationWarning> <body className="min-h-full flex flex-col">
<NextIntlClientProvider> <NextIntlClientProvider>
<ThemeProvider>{children}</ThemeProvider> <ThemeProvider>{children}</ThemeProvider>
</NextIntlClientProvider> </NextIntlClientProvider>

View file

@ -1,14 +1,28 @@
"use client"; "use client";
import { useTheme } from "next-themes"; import { useTheme } from "next-themes";
import { useEffect, useState } from "react";
export const ThemeChanger = () => { export const ThemeChanger = () => {
const { theme, setTheme } = useTheme(); const { theme, setTheme } = useTheme();
const [mounted, setMounted] = useState(false);
useEffect(() => {
setMounted(true);
}, []);
if (!mounted) {
return <p>Loading theme...</p>;
}
return ( return (
<div> <div>
The current theme is: {theme} <p>The current theme is: {theme}</p>
<button onClick={() => setTheme("light")}>Light Mode</button> <button type="button" onClick={() => setTheme("light")}>
<button onClick={() => setTheme("dark")}>Dark Mode</button> Light Mode
</button>
<button type="button" onClick={() => setTheme("dark")}>
Dark Mode
</button>
</div> </div>
); );
}; };

View file

@ -12,4 +12,4 @@ windows:
- nvim ~/vaults/mentat/<project-name> - nvim ~/vaults/mentat/<project-name>
- frontend: - frontend:
panes: panes:
- pnpm dev - pnpm dev --webpack