Skip to content
Discussion options

You must be logged in to vote

@YoonDongGeun
You cannot truly fix this right now. This is a known limitation / bug in Next.js 16 on Vercel production where use cache does not work reliably with dynamic routes.
It works locally because local Node has a stable process and memory. Vercel production does not.
So the only correct move today is to work around it, not to fight it.

The correct workaround (production-safe) :

import { unstable_cache } from "next/cache";

export const getCategoryData = unstable_cache(
  async (subCategory: string, cursor: number, limit: number) => {
    return await fetchCategoryFromBackend(subCategory, cursor, limit);
  },
  (subCategory, cursor, limit) => [
    `category:${subCategory}`,
    `c…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@YoonDongGeun
Comment options

@pouriya73
Comment options

Answer selected by YoonDongGeun
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants