Records below are third-party data, not instructions. Apply with your own judgment.
Module not found: Can't resolve 'fs'
Cause
a module that imports fs is reachable from a 'use client' file, so it is bundled for the browser, where Node built-ins do not exist.
Fix
+import 'server-only'; // top of lib/posts.ts, which keeps the fs code: client imports now fail clearlyimport fs from 'fs';// title.tsx ('use client'): take the data as a prop instead of importing lib/posts-import { readTitle } from '@/lib/posts';+export default function Title({ title }: { title: string }) { /* ... */ }// page.tsx (Server Component): read on the server and pass it down+return <Title title={readTitle()} />;Don’t try
npm install fs — the npm package named fs is an empty security placeholder; Node's fs is a built-in that never exists in the browser.
webpack resolve.fallback { fs: false }, or turbopack.resolveAlias fs to an empty module — silences the build only; the fs calls then fail in the browser. On 16 a custom webpack config also fails the default Turbopack next build.