Build fails when I use a server function middleware with a server function
The middleware reads the user's data from a session cookie.
From what I understand, the error is about me trying to run server-only code on the client side (like reading the encrypted session data), but I created my middleware using the
server()
method, so I'm confused.
Reproduction
I forked the basic example and added a commit to it to reproduce the issue.
Commit: https://github.com/fulopkovacs/tanstack-start-middleware-issue/commit/60d7283c05ab71353d6014f062242f72fd8be12e#diff-6aa551c33ca5fabc618706416b028e5ce253ca1e09a72d61fe0163b09e2bbcae
Repo: https://github.com/fulopkovacs/tanstack-start-middleware-issue
β This is the error:
I started using TanStack Start a week ago and am still a newbie. π
Would be really grateful for some help with this! πGitHub
GitHub - fulopkovacs/tanstack-start-middleware-issue: Repro of an i...
Repro of an issue with server function middlewares. - fulopkovacs/tanstack-start-middleware-issue
4 Replies
causal-orangeβ’4mo ago
where is the server function/Middleware defined and used?
also wrong channel btw
solid-orangeOPβ’4mo ago
oh sorry about the channel
causal-orangeβ’4mo ago
we have #start-questions
np
next time π
solid-orangeOPβ’4mo ago
I can't see that channel tho
ah it was under the "Show all" button
I'll move the post there, and respond under the new post! Thank you for the quick respnse βΊοΈ