[Vercel部署异常] api请求失败,导致页面显示undefined
描述bug 【此项必填】简单说明目前出现的现象、相关的错误提示、日志等、截图
api请求失败,导致页面显示undefined,vercel部署失败
[API-->>请求] from:index id:254dc8b29b5480fe8483d7xxxxxx 剩余重试次数:2
[API<<--异常]: HTTPError: Request failed with status code 400 Bad Request: POST https://www.notion.so/api/v3/syncRecordValues
at function_ (file:///app/node_modules/ky/distribution/core/Ky.js:31:29)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async result.<computed> [as json] (file:///app/node_modules/ky/distribution/core/Ky.js:62:34)
at async NotionAPI.getPage (file:///app/node_modules/notion-client/build/index.js:60:27)
at async d (/app/.next/server/chunks/36362.js:2:19031)
at async d (/app/.next/server/chunks/36362.js:2:19263)
at async /app/.next/server/chunks/36362.js:2:18776
at async d (/app/.next/server/chunks/36362.js:1:698)
at async u (/app/.next/server/chunks/36362.js:2:18701)
at async /app/.next/server/chunks/36362.js:1:3445 {
response: Response {
status: 400,
statusText: 'Bad Request',
headers: Headers {
date: 'Wed, 20 Aug 2025 00:46:16 GMT',
'content-type': 'text/plain',
'content-length': '84',
connection: 'keep-alive',
'set-cookie': '__cf_bm=jJwjRLfpv39OOUergG3pkJdojHdPn5A.de_9ls3NRbQ-1755650776-1.0.1.1-0U36y7xQvZAOMloyWer8gPQliMRmfLrQhsUa4VaDU8u0_kYtnsq9OtGpExnuIFIaq8M.Qxgqc2RnhtgVPPdDmYLI2nYxH3yKqO4IQHg8yKw; path=/; expires=Wed, 20-Aug-25 01:16:16 GMT; domain=.notion.so; HttpOnly; Secure; SameSite=None',
vary: 'Accept-Encoding',
'strict-transport-security': 'max-age=31536000; includeSubDomains; preload',
'x-content-type-options': 'nosniff',
server: 'cloudflare',
'cf-ray': '971ddf6a7c00cba4-LAX',
'alt-svc': 'h3=":443"; ma=86400'
},
body: ReadableStream { locked: false, state: 'readable', supportsBYOB: true },
bodyUsed: false,
ok: false,
redirected: false,
type: 'basic',
url: 'https://www.notion.so/api/v3/syncRecordValues'
},
request: Request {
method: 'POST',
url: 'https://www.notion.so/api/v3/syncRecordValues',
headers: Headers { 'content-type': 'application/json', accept: 'application/json' },
destination: '',
referrer: 'about:client',
referrerPolicy: '',
mode: 'cors',
credentials: 'same-origin',
cache: 'default',
redirect: 'follow',
integrity: '',
keepalive: false,
isReloadNavigation: false,
isHistoryNavigation: false,
signal: AbortSignal { aborted: false }
},
options: {
json: { requests: [Array] },
headers: Headers { 'content-type': 'application/json' },
method: 'POST',
hooks: {
beforeRequest: [],
beforeRetry: [],
afterResponse: [],
beforeError: []
},
prefixUrl: '',
retry: {
limit: 2,
methods: [Array],
statusCodes: [Array],
afterStatusCodes: [Array],
maxRetryAfter: Infinity,
backoffLimit: Infinity,
delay: [Function: delay]
},
throwHttpErrors: true,
timeout: 10000,
fetch: [Function: bound fetch],
signal: AbortSignal { aborted: false },
duplex: 'half',
body: '{"requests":[{"table":"block","id":"254dc8b2-9b54-8176-8780-xxxxxxx","version":-1}]}'
}
}
期望的正常结果 【此项必填】按这个步骤,预期出现的现象应该是什么
复现步骤 【此项必填】你的操作步骤,按此步骤理应在我的开发环境出现一样的bug。
环境
- 【必填】NotionNext版本 [例如. 4.0.18]
- [4.8.6]
- 【必填】主题 [例如. hexo]
- simple
- 【必填】部署方案 [例如. vercel]
- docker
- 【可选】操作系统: [例如. iOS, Android, macOS, windows]
- debian
- 【可选】浏览器 [例如. chrome, safari, firefox] chrome.firefox 补充说明 【可选】与问题相关的其它说明
你应该是跟我一样的问题,就是拿不到notion的page的数据。 我已经report 了notion help了,建议其他人也去notion(人类)客服那里投诉
一样问题+1
官方改变api调用方式了,要使用token的方式,但是作者这个还是之前被废弃的调用方式,我是申请了token,但是我不会改源代码啊,要改的话应该要改很多地方吧,静静等待中。
配置里有个NOTION_TOKEN_V2 试试这个
NOTION_TOKEN_V2
您说的是vercel添加环境变量吗?
配置里有个NOTION_TOKEN_V2 试试这个
这个怎么搞?
官方改变api调用方式了,要使用token的方式,但是作者这个还是之前被废弃的调用方式,我是申请了token,但是我不会改源代码啊,要改的话应该要改很多地方吧,静静等待中。
就是没有用notion api的方式去取notion的数据。https://developers.notion.com/docs/create-a-notion-integration。希望可以快点改吧
官方改变api调用方式了,要使用token的方式,但是作者这个还是之前被废弃的调用方式,我是申请了token,但是我不会改源代码啊,要改的话应该要改很多地方吧,静静等待中。
就是没有用notion api的方式去取notion的数据。https://developers.notion.com/docs/create-a-notion-integration。希望可以快点改吧
之前还可以将就用,现在直接调不出来了。这个有些日子了,不知道啥时候可以改。
你应该是跟我一样的问题,就是拿不到notion的page的数据。 我已经report 了notion help了,建议其他人也去notion(人类)客服那里投诉
这个出于安全来说notion应该做的是对的,这样就不是谁都可以调用笔记了。
官方改变api调用方式了,要使用token的方式,但是作者这个还是之前被废弃的调用方式,我是申请了token,但是我不会改源代码啊,要改的话应该要改很多地方吧,静静等待中。
就是没有用notion api的方式去取notion的数据。https://developers.notion.com/docs/create-a-notion-integration。希望可以快点改吧
之前还可以将就用,现在直接调不出来了。这个有些日子了,不知道啥时候可以改。
我已经去提new feature了,不知道他们什么时候会做,希望可以改吧,就是改动可能会大。 已经这两个月我已经遇到了2次网站奔溃了,都是notion数据问题
+1,今早更新文章突然就连不到notion了
+1
相关问题提供了一个临时的补丁,更新至最新的NotionNext可以正常获取数据。
后续会跟进替换成官方的API。
https://github.com/tangly1024/NotionNext/issues/3566
下午更新了NotionNext可以调用,晚上又无法调用API了,现在还有什么解决办法吗?
更新最新分支之后仍然复现此问题
老版本的在哪里修改呢?
+1
+1,使用最新版本部署也存在400错误
现在还是报错的