[blitz-rpc] rpcAppHandler 在 GET 查询时因 SyntaxError (await req.json()) 而崩溃,并读取不存在的路由参数,而不是 searchParams
作者: codeCraft-Ritik创建于 2026年9月26日更新于 2026年9月26日
标签kind/bugstatus/triage
- Define a Blitz query configured with
httpMethod = "GET":
// src/queries/getUser.ts
export default async function getUser(input: { id: number }) {
return { id: input.id, name: "Alice" }
}
export const config = {
httpMethod: "GET",
}- Mount the App Router RPC route in
src/app/api/rpc/[[...blitz]]/route.ts:
import { rpcAppHandler } from
…内容来源: blitz-js/blitz