Solved: Vinxi `getRequestURL` forces SRR even when wrapped in `isServer` / `import.meta.env.SSR`
- Without the
getRequestURL
call, the page loads and form submits happen via RPC (/_server
)
- With the getRequestURL
, even though it is wrapped in a server-side check (so it only happens during SSR but not on client hydration / re-renders); the browser shows a POST request to the route when submitting the form and the page reloads
However, calling a custom function which contains "use server"
works fine - the client sends a RPC call and no issues
It's specifically getRequestURL
that's interacting weirdly with how pages should be rendered - server/client side
Please could I have some help?
For reference,
I'm only just getting started with solid & solidstart, and AI has no idea what it's talking about, completely making up imports for functions that don't exist like useRouteData
and createServerFunction$
1 Reply
getRequestEvent()?.request.url
works as intended, I'll stay clear of the vinxi functions where possible to avoid this forced-SRR behavior