Node Stream error on build.
I am having a build issue when using alias but ONLY on my data routes running server side. I am assuming this is a issue with my
app.config and vinxi bundle. This is my setup:
tsconfig
13 Replies
extended-salmon•6mo ago
which errors do you have?
rare-sapphireOP•6mo ago
You are so fast haha, im putting them in discord limits the char count
__root.tsx
app.config
extended-salmon•6mo ago
does getSessionData call any server stuff?
if yes, it must be wrapped into a server function
otherwise it would run on the client as well
rare-sapphireOP•6mo ago
I do have it wrapped
extended-salmon•6mo ago
can you paste the full file where that server function is defined?
sometimes its caused by some server thing being exported from a file that defines a server funciton
rare-sapphireOP•6mo ago
If I use the direct path
../../../../whatever/* it builds fine - its only when I alias
For example if I import everything like this
It builds fineextended-salmon•6mo ago
the issue is the export of useAppSession
move this into another file to test
rare-sapphireOP•6mo ago
useAppSession is in another file I put the
========= to show a file break and how im calling it. I got useAppSession isolated and getSessionData in its own file as wellextended-salmon•6mo ago
probably best if you can provide a complete minimal example repo then
rare-sapphireOP•6mo ago
@Manuel Schiller https://github.com/j-mcfarlane/tanstack-min
GitHub
GitHub - j-mcfarlane/tanstack-min
Contribute to j-mcfarlane/tanstack-min development by creating an account on GitHub.
rare-sapphireOP•6mo ago
pnpm i and pnpm run build
inside __root.tsx you can toggle between alias and absolute import to see the error
@Manuel Schiller any ideas?xenial-black•6mo ago
Your probably leaking server code into client, i would recommend adding vite-env-only plugin to figure out better what you are importing.
rare-sapphireOP•6mo ago
Thanks @nikus will try this