TanStack / TanStack/cli

Error in production but not caught by linter via pnpm build

未关闭
#167 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
TypeScript
星标
1.3k
派生
185
平均合并
18 小时 45 分钟
30 天内合并 PR
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

https://github.com/remusris/tanstack-start-deployment-bug/blob/master/src/components/ComponentWithImportedZod.tsx

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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从链接的复现仓库中的 src/components/ComponentWithImportedZod.tsx 开始,然后运行 pnpm build,并将其结果与已部署的 Vercel 响应进行比较。追踪为什么将一个 const 从 route 导出到外部组件会导致部署后的 500 错误;当复现不再以该故障完成部署,或问题在 build 期间被报告时,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
typescript
领域
build-system, cloud
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。