错误:不变:revalidateTag 中缺少静态生成存储

Kir*_*eck 5 app-router next.js

\n

错误:不变:revalidateTag 中缺少静态生成存储

\n
\n

revalidatePath(path);I\xe2\x80\x99ve在 a 中的应用程序路由器项目中使用'use client',一个没有标头的组件,并且'use server'. 每次我得到

\n
Error: Invariant: static generation store missing in revalidateTag_[hash-here]\n
Run Code Online (Sandbox Code Playgroud)\n

使用下一个14.0.1

\n

小智 0

创建名为 actions.ts 的文件到 /app/actions.ts ....放这个例子:

"use server";

import { revalidateTag } from "next/cache";

export default async function action() {
  revalidateTag("profile");
}
Run Code Online (Sandbox Code Playgroud)

现在只需调用操作并享受...