Hono on Vercel example throws 502 when running `vercel dev`
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- node.js, typescript
调研方向
从 package.json 和 src/index.ts 开始,然后使用 hono-on-vercel 示例通过 vercel dev 重现该故障。将本地使用的 TypeScript 版本和编译器选项与 Vercel 开发运行时使用的版本和选项进行比较。当该示例能够在本地启动,并且 http://localhost:3000 不再返回 502 时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Context
The hono-on-vercel works as expected when using the 1-click "Deploy" button on Vercel. But pull down the repository, make no changes, run vercel dev, and then go to http://localhost:3000 and it immediately throws 502 Bad Gateway.
Response
502: BAD_GATEWAY
Code: NO_RESPONSE_FROM_FUNCTION
Error output
> Ready! Available at http://localhost:3000
/Users/lance/Library/pnpm/global/5/.pnpm/[email protected]_@[email protected][email protected]/node_modules/ts-node/src/index.ts:859
return new TSError(diagnosticText, diagnosticCodes, diagnostics);
^
TSError: ⨯ Unable to compile TypeScript:
error TS5023: Unknown compiler option 'verbatimModuleSyntax'.
at createTSError (/Users/lance/Library/pnpm/global/5/.pnpm/[email protected]_@[email protected][email protected]/node_modules/ts-node/src/index.ts:859:12)
at reportTSError (/Users/lance/Library/pnpm/global/5/.pnpm/[email protected]_@[email protected][email protected]/node_modules/ts-node/src/index.ts:863:19)
at createFromPreloadedConfig (/Users/lance/Library/pnpm/global/5/.pnpm/[email protected]_@[email protected][email protected]/node_modules/ts-node/src/index.ts:874:36)
at create (/Users/lance/Library/pnpm/global/5/.pnpm/[email protected]_@[email protected][email protected]/node_modules/ts-node/src/index.ts:624:10)
at Object.register (/Users/lance/Library/pnpm/global/5/.pnpm/[email protected]_@[email protected][email protected]/node_modules/ts-node/src/index.ts:591:15)
at Object.<anonymous> (/Users/lance/Library/pnpm/global/5/.pnpm/[email protected]_@[email protected][email protected]/node_modules/ts-node/register/index.js:1:16)
at Module._compile (node:internal/modules/cjs/loader:1706:14)
at Object..js (node:internal/modules/cjs/loader:1839:10)
at Module.load (node:internal/modules/cjs/loader:1441:32)
at Function._load (node:internal/modules/cjs/loader:1263:12) {
diagnosticCodes: [ 5023 ]
}
Error: Function `src/index.ts` failed with exit code 1
Steps to reproduce
- Go to https://vercel.com/templates/backend/hono-on-vercel
- Click the black Deploy button in the upper right corner of the page next to the View Demo button
- Connect via a Provider (I used GitHub)
- Give the repo a name, select a Team, and click the Create button
- Watch Vercel build and deploy the project
- Continue to Vercel Dashboard, find the Domain, and open the hono app to verify it works as expected ✅
- Click the Repository button in the upper right
- Clone the git repo to local machine and
cdinto the project - run
vercel dev - Set up and develop: Y
- Select Vercel scope
- Link to the project it finds: Y
- Server starts up:
Ready! Available at http://localhost:3000 - Navigate to http://localhost:3000
- A 502 Bad Gateway response is served and the error above is logged
Possible Diagnosis
Why does Vercel 48.1.6 (latest) install typescript 4.9.5 despite package.json specifies "typescript": "^5.8.3". The TypeScript flag verbatimModuleSyntax is only available in v5+.
% pnpm why --global typescript
Legend: production dependency, optional only, dev only
/Users/lance/Library/pnpm/global/5
dependencies:
vercel 48.1.6
├─┬ @vercel/express 0.0.22
│ └─┬ @vercel/node 5.3.24
│ ├─┬ ts-node 10.9.1
│ │ └── typescript 4.9.5 peer
│ └── typescript 4.9.5
├─┬ @vercel/h3 0.1.2
│ └─┬ @vercel/node 5.3.24
│ ├─┬ ts-node 10.9.1
│ │ └── typescript 4.9.5 peer
│ └── typescript 4.9.5
├─┬ @vercel/hono 0.1.2
│ └─┬ @vercel/node 5.3.24
│ ├─┬ ts-node 10.9.1
│ │ └── typescript 4.9.5 peer
│ └── typescript 4.9.5
└─┬ @vercel/node 5.3.24
├─┬ ts-node 10.9.1
│ └── typescript 4.9.5 peer
└── typescript 4.9.5
- 主要语言
- TypeScript
- 星标
- 5.2k
- 派生
- 1.9k
- 平均合并
- 1 小时 4 分钟
- 30 天内合并 PR
- 2
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
vercel/examples 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
[next-chat] Typing indicator gets stuck when a socket disconnects mid-typing可能已有人在做 @officialasishkumar 于 12 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 55/100
维护者通常 1 天内回复
-
CARGO-TAXI未关闭
难度 5/5 一周以上 新手友好度 10/100
维护者通常 1 天内回复
-
Better Choicez未关闭
难度 5/5 一周以上 新手友好度 15/100
vercel/examples#1584 · 2 个 reaction ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 32/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
AykutSarac/jsoncrack.com#616 ·
-
nip27: long hashtag swallows the rest of the content, lone # gives an empty hashtag可能已有人在做 @bardrop 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
nbd-wtf/nostr-tools#578 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
backnotprop/plannotator#3427 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
microsoft/Power-CAT-Copilot-Studio-Kit#942 ·
维护者通常 1 天内回复
-
[BUG]: Duplicate preposition in heading and unformatted feedback text on Strengthen Argument page未关闭bug
难度 2/5 1-3 小时 新手友好度 72/100
AOSSIE-Org/DebateAI#801 · 1 条评论 ·
维护者通常 1 天内回复