Skip to content

fix: lazy-load persistence module to fix client-side build error#4

Merged
seanebones-lang merged 1 commit into
mainfrom
claude/enhance-system-agents-lk66U
Mar 17, 2026
Merged

fix: lazy-load persistence module to fix client-side build error#4
seanebones-lang merged 1 commit into
mainfrom
claude/enhance-system-agents-lk66U

Conversation

@seanebones-lang
Copy link
Copy Markdown
Owner

The build was failing with "Module not found: Can't resolve 'fs'" because persistence.ts (which uses Node.js fs module) was statically imported by agent-memory.ts, which is transitively imported by client components.

Replace the static import with a lazy require() that only loads on the server side, preventing webpack from trying to bundle the fs module.

https://claude.ai/code/session_01EgmjHaEN3MdD47o3BgynKV

The build was failing with "Module not found: Can't resolve 'fs'" because
persistence.ts (which uses Node.js fs module) was statically imported by
agent-memory.ts, which is transitively imported by client components.

Replace the static import with a lazy require() that only loads on the
server side, preventing webpack from trying to bundle the fs module.

https://claude.ai/code/session_01EgmjHaEN3MdD47o3BgynKV
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Mar 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
grokcode Error Error Mar 17, 2026 11:39pm

Request Review

@seanebones-lang seanebones-lang merged commit 265ddf2 into main Mar 17, 2026
1 of 2 checks passed
@seanebones-lang seanebones-lang deleted the claude/enhance-system-agents-lk66U branch March 17, 2026 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants