next.js - 错误:`revalidate` 属性还不能用于一般用途
问题描述
我的 package.json 文件是
{
"name": "learn-starter",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"export": "next export"
},
"dependencies": {
"@tailwindcss/typography": "^0.2.0",
"date-fns": "^2.16.1",
"geolib": "^3.3.1",
"google-map-react": "^2.1.3",
"graphql": "^15.3.0",
"graphql-request": "3.0.0",
"gray-matter": "^4.0.2",
"isomorphic-unfetch": "^3.0.0",
"libphonenumber-js": "^1.7.57",
"next": "9.3.5",
"next-seo": "^4.7.3",
"react": "16.13.1",
"react-animated-css": "^1.2.1",
"react-dom": "16.13.1",
"react-gtm-module": "^2.0.11",
"react-static-google-map": "^0.6.2",
"remark": "^12.0.1",
"remark-html": "^12.0.0",
"tailwindcss": "^1.7.6",
"use-position": "^0.0.7"
},
"devDependencies": {}
}
我正在尝试在 getStaticProps 中使用 revaildate: 1 但我收到错误消息
Error: The `revalidate` property is not yet available for general use.
To try the experimental implementation, please use `unstable_revalidate` instead.
正如我在 package.json 文件中看到的那样,我的 nextjs 版本是 9.3.5 谁能帮我解决这个问题。
解决方案
尝试使用“unstable_revalidate”而不是“revalidate”,因为在 nextjs 版本 <9.5 中,“revalidate”关键字尚未通用。
推荐阅读
- sql - SQL 内连接未在 VIEW 中组合表
- django - 当您无法使用 select_related 时,如何避免在 Django 中进行 n+1 查询?
- salesforce-marketing-cloud - 未在 Journey builder 中注入的记录 - Salesforce 数据输入源
- java - Socket 无法在 SikuliX IDE 上连接,但打包后可以连接
- ggfortify - 使用自动绘图为线性模型上使用的 ggfortify 对象生成交互式绘图
- javascript - 如何在带有 Google 地图 API 的 asp.net MVC 中使用两个地图?
- python - 如何将 keras cnn 模型转换为 pytorch 版本
- python - 在错误处理中获取文件路径 - python
- python - Django 项目运行 manage.py 导致没有名为 django 的模块
- browser - 设置可见性后更改元素的宽度是否会导致重排:隐藏?