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
fair-rose•3mo ago
which errors do you have?
stormy-goldOP•3mo ago
You are so fast haha, im putting them in discord limits the char count
__root.tsx
app.config
fair-rose•3mo 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
stormy-goldOP•3mo ago
I do have it wrapped
fair-rose•3mo 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
stormy-goldOP•3mo 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 finefair-rose•3mo ago
the issue is the export of useAppSession
move this into another file to test
stormy-goldOP•3mo 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 wellfair-rose•3mo ago
probably best if you can provide a complete minimal example repo then
stormy-goldOP•3mo 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.
stormy-goldOP•3mo 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?optimistic-gold•3mo ago
Your probably leaking server code into client, i would recommend adding vite-env-only plugin to figure out better what you are importing.
stormy-goldOP•3mo ago
Thanks @nikus will try this