500 error creating API route
Trying to create my first API route.
1. I added
/app/api.ts
as noted here: https://tanstack.com/start/latest/docs/framework/react/api-routes#setting-up-the-entry-handler
2. ) I added /app/api/hello.ts
with the example code:
3. Then I restarted the dev server (a bunch of times) using "dev": "vinxi dev"
as my package.json
script.
500 error
Suggestions?
Versions:
API Routes | TanStack Start React Docs
API Routes are a powerful feature of TanStack Start that allow you to create server-side endpoints in your application without the need for a separate server. API Routes are useful for handling form s...
7 Replies
national-goldā¢6mo ago
Please switch to
@tanstack/react-start
. There's probably an issue with the exports in the old package. The old package will be going away soon anyways.extended-salmonOPā¢6mo ago
That worked! Ty! I fixed it in my version and will let convex, whose template I started with know to update it there too
national-goldā¢6mo ago
You mind pointing me to the template?
I'd rather contribute the fix for them, without having to create work for them.
extended-salmonOPā¢6mo ago
It's the one installed from here:
npm create convex@latest -- -t tanstack-start
https://docs.convex.dev/quickstart/tanstack-start
Tom from Convex sharing a link to the repo https://discord.com/channels/1019350475847499849/1280662562152644660/1351260622293041254national-goldā¢6mo ago
Ah! Tom (@ballingt) is on it. š
šš¼
optimistic-goldā¢6mo ago
Thanks @Sean Cassiere, you're all doing so much good work it's hard to keep up with š
national-goldā¢6mo ago
sry š
I'll ping you once we're done with Devinxi. So we can get the examples updated on the convex side of things.