-
-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(trpc): adding host and port env variables to nitro dev process & … #695
Conversation
✅ Deploy Preview for analog-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for analog-blog ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for analog-app ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
…using them for trpc during dev $fetch is smart enough to infer the host and port for our trpc client when it is used on the server. However, $fetch is only available during the pre-render phase and during SSR of the prod nitro server. It is not available during development when we work with the vite server. This PR adds the host & port from the vite server as env variables and uses them as fallbacks. It also adjusts the Nx plugin's and trpc-app's vite config files to make sure that the index page is server side rendered, but not pre-rendered to avoid not displaying the latest data.
5a5922b
to
7df4901
Compare
@brandonroberts I am not crazy and this should finally allow for relative paths to be used with trpc as well as giving you a setup that by default server renders the index page with tRPC so the latest data is always shown... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
…using them for trpc during dev
$fetch is smart enough to infer the host and port for our trpc client
when it is used on the server. However, $fetch is only available during
the pre-render phase and during SSR of the prod nitro server. It is not
available during development when we work with the vite server. This PR
adds the host & port from the vite server as env variables and uses them
as fallbacks. It also adjusts the Nx plugin's and trpc-app's vite config
files to make sure that the index page is server side rendered, but not
pre-rendered to avoid not displaying the latest data.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Which package are you modifying?
What is the current behavior?
Closes #
What is the new behavior?
Does this PR introduce a breaking change?
Other information
[optional] What gif best describes this PR or how it makes you feel?