Next.js `basePath`: queue-triggered flow route fails on Vercel with MODULE_NOT_FOUND `.next/server/pages/<basePath>/.well-known/workflow/v1/flow.js`
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 42/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- next.js, node.js, typescript
调研方向
Start by tracing how the Vercel build output and route table handle the workflow flow route when basePath is set; the issue names .next/server/app/.well-known/workflow/v1/flow/route.js, routes-manifest.json, and app-path-routes-manifest.json. Compare those entries with the failing launcher lookup under pages/admin/.well-known/workflow/v1/flow.js and the behavior without basePath. Done means queue deliveries reach the App Router handler on Vercel with basePath enabled.
由索引模型根据 Issue 内容生成。
描述
Summary
A Next.js app with basePath: "/admin" deploys to Vercel. Every queue delivery to the flow route fails before any user code runs, so no workflow run ever leaves queued. Runs started with start() are accepted, then retried every ~5 s forever.
This looks like the follow-up named in #2732: "the generated Vercel/Next output serves internal workflow invocation at /v2/.well-known/workflow/v1/flow, but [...] appears to be a Vercel/Next build-output route-table issue". #1864 reported the same error and was closed by #2732, but the platform part still reproduces on current versions. #3483 (also basePath: '/v2') may be the same defect seen from the queue side.
Versions
next16.2.6 (App Router, Turbopack build)workflow5.2.2,@workflow/next5.0.5,@workflow/core5.2.2,@workflow/world-vercel5.2.2,@vercel/queue0.8.0- pnpm monorepo, app at
apps/admin(launcher runs from/var/task/apps/admin) - Fluid compute, Node.js runtime, Pro team
Configuration
next.config.ts (simplified):
export default withWorkflow({
basePath: "/admin",
// ...
})
proxy.ts excludes the workflow routes, as the docs ask:
matcher: ["/", "/((?!\\.well-known/workflow/|_next/static|_next/image|favicon.ico).*)"]
What happens
The queue (User-Agent: vercel-queue/v2beta) sends POST /admin/.well-known/workflow/v1/flow. The function fails in ~8–23 ms with FUNCTION_INVOCATION_FAILED:
Failed to handle /admin/.well-known/workflow/v1/flow Error: Cannot find module './.next/server/pages/admin/.well-known/workflow/v1/flow.js'
Require stack:
- /var/task/apps/admin/___next_launcher.cjs
- /opt/rust/nodejs.js
code: 'MODULE_NOT_FOUND'
- Observability lists the route as
/admin/.well-known/workflow/v1/flow(with the base path). Every other route in the same deployment is listed without it, e.g./assistant. - The launcher looks under
pages/and includes the base path segment. - The build emits the handler as an App Router route:
.next/server/app/.well-known/workflow/v1/flow/route.js.routes-manifest.jsonandapp-path-routes-manifest.jsonlist/.well-known/workflow/v1/flow. app/.well-known/workflow/v1/config.jsonholds thequeue/v2betatrigger for topic__wkf_workflow_*.
Expected
The queue trigger invokes the App Router handler at app/.well-known/workflow/v1/flow/route.js, as it does for an app without basePath.
Evidence
- Deployment:
dpl_CaToLKmeYmbxizgPPnDbv9guLFsL(production, branchmain) - Workflow run:
wrun_41M5EFC5JP90T9NVPKN8WSWW0X - Request ID:
zjnrt-1792562314900-3ec8808307b5(2026-10-21 05:58:34 UTC,sin1)
Questions
- Is there a supported way to run Workflow on Vercel with a Next.js
basePathtoday? - If not, is there a workaround that keeps
basePath(the app is a Multi-Zones zone mounted at/admin)?
- 主要语言
- TypeScript
- 星标
- 2.5k
- 派生
- 401
- 平均合并
- 1 天 21 小时
- 30 天内合并 PR
- 201
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
vercel/workflow 的其他 Issue
-
getPortLazy re-runs OS port discovery on every call when it finds no port可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
node-module-esbuild-plugin: getImportedIdentifier only checks the first named import when locating a violation可能已有人在做 @div-cowboy 于 6 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
vercel/workflow#5057 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
code-transform.mdx §ID Generation omits the package-shipped `name@version` ID form可能已有人在做 @Mohith26 于 113 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 1 天内回复
相似的 Issue
-
type: bug
难度 2/5 1-3 小时 新手友好度 78/100
nrwl/nx#37955 · 1 个 reaction ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 67/100
db-ux-design-system/core-web#8856 ·
维护者通常 1 天内回复
-
'!' breaking change is lost when the commit also has an empty BREAKING CHANGE footer可能已有人在做 @wittdennis 今天认领。 未关闭priority: p3 type: bug
难度 2/5 1-3 小时 新手友好度 74/100
googleapis/release-please#2971 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 87/100
维护者通常 1 天内回复
-
🛠️ dette technique
难度 2/5 1-3 小时 新手友好度 61/100
betagouv/mon-entreprise#4752 · 1 条评论 ·
维护者通常 5 天内回复