Express 5: /v1/research/batch/* 路由在注册时抛出了 PathError,且 req.params[0] 为 undefined
作者: rattusrattus创建于 2026年9月4日更新于 2026年9月4日
api/routes/research.ts 使用通配符注册批处理路由,并按位置读取它:
researchRoutes.get('/batch/*', async (req, res) => {
const filePath = req.params[0]package.json 设置了 express: ^5.2.1。Express 5 移到了 path-to-regexp v8,该版本需要一个 命名 通配符,并通过名称而不是通过索引来暴露它,因此这两行都受到影响。
内容来源: elder-plinius/G0DM0D3