#4467·blitz

[blitz-rpc] rpcAppHandler 在 GET 查询时因 SyntaxError (await req.json()) 而崩溃,并读取不存在的路由参数,而不是 searchParams

作者: codeCraft-Ritik创建于 2026年9月26日更新于 2026年9月26日
标签kind/bugstatus/triage
  1. Define a Blitz query configured with httpMethod = "GET":
bash
// src/queries/getUser.ts
export default async function getUser(input: { id: number }) {
  return { id: input.id, name: "Alice" }
}
export const config = {
  httpMethod: "GET",
}
  1. Mount the App Router RPC route in src/app/api/rpc/[[...blitz]]/route.ts:
app
import { rpcAppHandler } from
…