giselles-ai / giselle

Giselle: AI for Agentic Workflows. Human-AI Collaboration. Open Source.
https://giselles.ai
Apache License 2.0
10 stars 4 forks source link

Fix ` Error: Failed to set Next.js data cache, items over 2MB can not be cached (2865842 bytes) at IncrementalCache.set` error on development #67

Closed satococoa closed 1 week ago

satococoa commented 1 week ago

Summary

On my local environemnt, I've noticed this warning.

⨯ unhandledRejection: Error: Failed to set Next.js data cache, items over 2MB can not be cached (2865842 bytes)
    at IncrementalCache.set (/Users/satoshi/dev/src/github.com/route06inc/giselle/node_modules/next/dist/server/lib/incremental-cache/index.js:358:23)
    at cacheNewResult (/Users/satoshi/dev/src/github.com/route06inc/giselle/.next/server/chunks/ssr/node_modules_37df5f._.js:25514:28)
    at cachedCb (/Users/satoshi/dev/src/github.com/route06inc/giselle/.next/server/chunks/ssr/node_modules_37df5f._.js:25667:21)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async $$RSC_SERVER_ACTION_0 (/Users/satoshi/dev/src/github.com/route06inc/giselle/.next/server/chunks/ssr/[root of the server]__f32a54._.js:714:12)
    at async AgentList (/Users/satoshi/dev/src/github.com/route06inc/giselle/.next/server/chunks/ssr/[root of the server]__f32a54._.js:907:23)

This PR fixes this error.

Changes

Fetch agents only the current user can use instead of fetching all agents from database.

Other Information

In Next.js 15, unstable_cache is not recommended. https://nextjs.org/docs/canary/app/api-reference/legacy-apis/unstable_cache But I didn't change that caching part in this PR.

vercel[bot] commented 1 week ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
giselle ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2024 1:57am