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.
Summary
On my local environemnt, I've noticed this warning.
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.