Error in production but not caught by linter via pnpm build
まだ誰も着手していません。
- 主要言語
- TypeScript
- スター
- 1.3k
- フォーク
- 185
- 平均マージ
- 18時間 45分
- マージ済み PR(30日)
- 2
説明
Which project does this relate to?
Create Tanstack App
Describe the bug
I discovered a bug because I was trying to figure out why my code was building and deplying without errors then upon visiting the deployed website getting the response back from the url in return.
{
"error": true,
"url": "https://tanstack-start-deployment-bug.vercel.app/",
"statusCode": 500,
"statusMessage": "Server Error",
"message": "Server Error"
}
I made a repo to demonstrate the issue
https://github.com/remusris/tanstack-start-deployment-bug
below is the deployment url
https://tanstack-start-deployment-bug.vercel.app/
Basically if you export a const from the a route into some component this will trigger the error in deployment.
If you look at the ComponentWithImportedZod.tsx file that is culprit of the issue
If this is non an error please let me know what I'm doing wrong.
Your Example Website or App
https://tanstack-start-deployment-bug.vercel.app/
Steps to Reproduce the Bug or Issue
Export a const from a file inside of routes into a component outside of routes. In this case it was a zod schema for validating searchParams
Expected behavior
The user does not get any build errors or deployment errors but once the URL is live all you get in response is
{
"error": true,
"url": "https://tanstack-start-deployment-bug.vercel.app/",
"statusCode": 500,
"statusMessage": "Server Error",
"message": "Server Error"
}
https://tanstack-start-deployment-bug.vercel.app/
Screenshots or Videos
Check out the url below
https://tanstack-start-deployment-bug.vercel.app/
Platform
Google Chrome | 140.0.7339.128 (Official Build) (64-bit) (cohort: Stable)
Revision | 36aa3351631d175ee5346a1aaf74ef5d49abe308-refs/branch-heads/7339@{#1850}
OS | Windows 11 Version 24H2 (Build 26100.6584)
Additional context
No response
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
リンクされた再現リポジトリの src/components/ComponentWithImportedZod.tsx から始め、次に pnpm build を実行して、その結果をデプロイされた Vercel のレスポンスと比較します。route から外部コンポーネントへ const をエクスポートすると、デプロイ後に 500 エラーが発生する理由を追跡します。再現環境がその失敗状態でデプロイされなくなるか、ビルド中に問題が報告されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- build-system, cloud
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100