TanStack / TanStack/cli

Error in production but not caught by linter via pnpm build

Offen
#167 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
TypeScript
Sterne
1.3k
Forks
185
Ø Merge
18 Std. 45 Min.
Gemergte PRs (30 T.)
2

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit src/components/ComponentWithImportedZod.tsx im verlinkten Reproduktions-Repository, führe dann pnpm build aus und vergleiche das Ergebnis mit der bereitgestellten Vercel-Antwort. Verfolge, warum das Exportieren eines const aus einer Route in eine externe Komponente einen bereitgestellten 500-Fehler verursacht; abgeschlossen ist die Aufgabe, wenn die Reproduktion nicht mehr mit diesem Fehler bereitgestellt wird oder das Problem während des Builds gemeldet wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript
Bereich
build-system, cloud
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.