T
TanStack3mo ago
rival-black

building for production

after updating to RC can't seem to run the build output in dist tried running the basic example with the command node dist/server/server.js and process exists with no message edit: also it seems vite wont longer load env variables from .env
18 Replies
ambitious-aqua
ambitious-aqua3mo ago
I think you need to configure a deployment such as nitro
rival-black
rival-blackOP3mo ago
wouldn build by default create a node runnable deployment? at least thats how it worked before the RC and i believe the docs still mention that its the default
rival-black
rival-blackOP3mo ago
for the env vars there is already a github issue here: https://github.com/TanStack/router/issues/5217
GitHub
Start RC - Environment Variables aren't loaded automatically · Iss...
Which project does this relate to? Start Describe the bug Environment variables are not automatically loaded as stated in the docs. Your Example Website or App https://github.com/ryanagillie/tansta...
rival-black
rival-blackOP3mo ago
it seems like the RC has quite alot of bugs right now i might just revert untill they are solved its more unstable than the beta ever was for me
rival-black
rival-blackOP3mo ago
yeah for me i deploy using a simple docker image had no issues up untill the update
ambitious-aqua
ambitious-aqua3mo ago
Hosting | TanStack Start React Docs
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...
rival-black
rival-blackOP3mo ago
no - all examples are broken im not sure how this got missed
ambitious-aqua
ambitious-aqua3mo ago
Hosting | TanStack Start React Docs
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...
ambitious-aqua
ambitious-aqua3mo ago
can either use nitro v2 or nitro v3
rival-black
rival-blackOP3mo ago
il just revert this release just isnt ready yet
ambitious-aqua
ambitious-aqua3mo ago
ok
like-gold
like-gold3mo ago
This section hasn't been updated for the RC yet. The generated output and artifacts differ from the pre-RC version and seemingly cannot be invoked directly which I used to do in my Docker image.
fair-rose
fair-rose3mo ago
I am not sure how this got missed in the rc, we should have some kind of test for this, that at least the production build is not broken for all the examples.
rival-black
rival-blackOP3mo ago
https://github.com/TanStack/router/issues/5263 its not just that the output is different nitro v2 does not work with npm only pnpm and v3 does not work for me with some dependencies like pg or argon2 and using srvx returns 404 for all static assets so doing a build is a lot of jumping through hoops while beta just worked
GitHub
RC: Build nitro node-server exception with initial request and ...
Which project does this relate to? Start Describe the bug Hi! I tried building using the nitro compatibility plugin and using node-server to mimic the setup I was using before upgrading to the RC a...
like-gold
like-gold3mo ago
Just dropping my observations here as well: I typically use Docker images to run my apps and for Start it was sufficient to use this before the RC:
# ...
COPY --from=installer --chown=tanstack:nodejs /app/apps/web-next/.output .
CMD ["node", "server/index.mjs"]
# ...
COPY --from=installer --chown=tanstack:nodejs /app/apps/web-next/.output .
CMD ["node", "server/index.mjs"]
With the new output format I have seen others recommend running the app with the pnpx srvx --prod -s ../client dist/server/server.js command which seemed to work locally, but I haven't had the time to investigate how to integrate this with my Dockerfile. I would've personally preferred to have a single entrypoint I can just call from node like before.
exotic-emerald
exotic-emerald2mo ago
documentation and migration guides have been updated as well as the nitro-v2-plugin has been fixed. https://tanstack.com/start/latest/docs/framework/react/hosting#using-nitro-v2 https://github.com/TanStack/router/discussions/2863#discussioncomment-14052148 if there are still issues, please create a new github issue including a complete minimal example.
like-gold
like-gold2mo ago
Yeah, using nitro-v2-plugin helped me to get the previous build behaviour back, thanks! That allowed me to use my Dockerfile as usual.

Did you find this page helpful?