Skip to content

fix: extract useConversations hook to dedicated context file#82

Merged
NicholaiVogel merged 3 commits intomainfrom
nicholai/fix-conversations-context
Feb 15, 2026
Merged

fix: extract useConversations hook to dedicated context file#82
NicholaiVogel merged 3 commits intomainfrom
nicholai/fix-conversations-context

Conversation

@NicholaiVogel
Copy link
Copy Markdown
Contributor

Summary

  • Move useConversations hook and ThreadMessage type from the layout file to a dedicated context file
  • Next.js layouts can only export the default component - hooks and types are not valid exports
  • Fixes Cloudflare build error: "useConversations" is not a valid Layout export field

Test plan

  • Run bun run build - passes with no type errors
  • Cloudflare build succeeds after merge

Move the conversations context and hook from the layout file to
src/contexts/conversations-context.tsx. Next.js layouts cannot export
hooks or types - only the default component export is allowed.
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Feb 15, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
compass cca9f54 Feb 15 2026, 03:56 AM

The memory-provider module imports better-sqlite3, a native Node.js
module that cannot run in Cloudflare Workers. This causes OpenNext
build failures when esbuild tries to resolve the module.

Changes:
- Use dynamically constructed import path to prevent static analysis
- Remove memory provider from getServerDb (never used on Cloudflare)
- Add memory-provider to serverExternalPackages in next.config.ts
The variable name 'module' is reserved in Next.js and causes ESLint
error @next/next/no-assign-module-variable.
@NicholaiVogel NicholaiVogel merged commit d5a28ee into main Feb 15, 2026
7 of 10 checks passed
@NicholaiVogel NicholaiVogel deleted the nicholai/fix-conversations-context branch February 15, 2026 03:57
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.

1 participant