问题1
notion api 获取到的relation 是空
解决方案
需要将relation的数据库connections到原项目
问题2
npm run dev的时候一切正常,在部署的时候报错:path.database_id should be a valid uuid, instead was
\\"undefined\\"
解决方案
Vercel 不会自动读取
.env
文件,需要手动配置环境变量。检查 Vercel 环境变量
确保在 Vercel 项目的设置中,所有必要的环境变量都已正确配置。特别是
NOTION_TOKEN
和 NOTION_DATABASE_ID
。- 登录到 Vercel 控制台。
- 选择你的项目。
- 转到“Settings” -> “Environment Variables”。
- 确认
NOTION_TOKEN
和NOTION_DATABASE_ID
都已正确设置。
问题3
在npm run build的时候。Type error: Could not find a declaration file for module 'prismjs/components/prism-markup-templating.js'. '/Users/jessie.chen/project/jessie-blog.dev/node_modules/prismjs/components/prism-markup-templating.js' implicitly has an 'any' type.
解决方案
这是一个常见的 TypeScript 错误,提示
prismjs
模块缺少类型声明。- 安装类型声明文件(如果存在):
npm install --save-dev @types/prismjs
- 手动添加模块声明文件:
在项目的根目录下创建一个
global.d.ts
文件,并在其中添加以下内容:
declare module "prismjs/components/prism-markup-templating.js"; declare module "prismjs/components/prism-markup.js"; declare module "prismjs/components/prism-bash.js"; declare module "prismjs/components/prism-c.js"; declare module "prismjs/components/prism-cpp.js"; declare module "prismjs/components/prism-csharp.js"; declare module "prismjs/components/prism-docker.js"; declare module "prismjs/components/prism-java.js"; declare module "prismjs/components/prism-js-templates.js"; declare module "prismjs/components/prism-coffeescript.js"; declare module "prismjs/components/prism-diff.js"; declare module "prismjs/components/prism-git.js"; declare module "prismjs/components/prism-go.js"; declare module "prismjs/components/prism-graphql.js"; declare module "prismjs/components/prism-handlebars.js"; declare module "prismjs/components/prism-less.js"; declare module "prismjs/components/prism-makefile.js"; declare module "prismjs/components/prism-markdown.js"; declare module "prismjs/components/prism-objectivec.js"; declare module "prismjs/components/prism-ocaml.js"; declare module "prismjs/components/prism-python.js"; declare module "prismjs/components/prism-reason.js"; declare module "prismjs/components/prism-rust.js"; declare module "prismjs/components/prism-sass.js"; declare module "prismjs/components/prism-scss.js"; declare module "prismjs/components/prism-solidity.js"; declare module "prismjs/components/prism-sql.js"; declare module "prismjs/components/prism-stylus.js"; declare module "prismjs/components/prism-swift.js"; declare module "prismjs/components/prism-wasm.js"; declare module "prismjs/components/prism-yaml.js";
- 完成这些步骤后,再次运行
npm run build