#Deploying tanstack start

15 messages · Page 1 of 1 (latest)

cursive imp
#

Hello, I know that this topic has been questioned a lot. but I have try to look into those threads, but still cant found any solution.
I also have check : https://tanstack.com/start/latest/docs/framework/react/guide/hosting#nodejs--docker

So when I run pnpm build, I got a dist folder with client and server inside it, but all of the docs is .output. So I think I'm just going to direct ⁨node .output/server/server.mjs⁩ to ⁨node dist/server/server.js⁩.

But after I change it, it doesnt even start.

But I try to use ⁨pnpm build⁩ then ⁨pnpm preview⁩, it works.

What did I missed here? thank you

Hosting is the process of deploying your application to the internet so that users can access it. This is a critical part of any web development project, ensuring your application is available to the...

rare leaf
#

if not, instead dist/server/server.js will be generated

#

but it's not a server per se, it's only a server fetcher which follows srvx convention

#

if you see below in the docs, there is an example bun server, but you can do it yourself with anything you want

#

but if you dont want optimizations, and simple just run the server, you can use this:

#

npx srvx --prod -s ../client dist/server/server.js

#

this spins up a srvx server, which server fetcher is the default export of dist/server/server.js, and the client assets are in ../client (relative to server.js)

#

however, if you don't really know what you're doing, you might as well install and setup nitro

#

the doc you linked, anchor included, even specifically and explicitely mentions that

cursive imp
#

OH MY GOD, you are correct. I dont have nitro installed.
I started this project using ⁨⁨pnpm create @tanstack/start@latest⁩⁩. Then in command line, I got this message :
⁨⁨```Warning: @tanstack/create-start is deprecated. Use "tanstack create" or "npx @tanstack/cli create" instead.
See: https://tanstack.com/start/latest/docs/framework/react/quick-start

So I immediately use that, but it doesnt let me choose options(query, form, sentry. prisma, etc..) like usual, but I continue along. I never realize nitro is not installed.

Thank you!!, (⁨⁨``if you don't really know what you're doing``⁩⁩, you are absolutely correct 🤣 )
rare leaf
#

glad to help ASpeepoSalute

rare leaf