+onBeforeRender will no longer run on the clientside hook when returning an empty {} #1522
Replies: 3 comments 7 replies
-
I ain't sure I understand. The best would be a minimal reproduction with two step-by-steps "what I expect" and "what happens instead". |
Beta Was this translation helpful? Give feedback.
-
Hey sorry for the delayed response and thanks for responding. The repos below have been stripped back but still contain the issue we face on trying to bump up to Vike and off vite-ssr-plugin. General info
Steps to run
App: https://github.com/john-cashin/vike-1522-client The issue we faced was that on The Playing around with some of the examples in the Vike repo. The normal behaviour seems to be to only hit the server of first load and client side from then after. Maybe this is an effect of using Vike as middleware. I leann more FE, so Node/Express isn't my expertise. Thanks again! |
Beta Was this translation helpful? Give feedback.
-
Hey so I think I've found the source of our issues and it lies in our use of API Routes. As mentioned above, our application seems to hit the express route/ VPSV1 seems to plug this and rightly throws an error as the pageContext is messed up coming from the server again. I've used Bati to scaffold our app and when I switch from the boilerplate express server to our own, the behaviour changes within the Sorry for wasting your time, but thank you for replying. At least I have something to work towards now. |
Beta Was this translation helpful? Give feedback.
-
Hello, in the process of moving up to
0.4.163
and have hit a little bump. We have a Vue ssr/client routing app on a single +Page.On
0.4.143
, to stop calling our api routes twice, we'd return{}
when we're on the server but clientside navigating.onBeforeRender
would then run clientside, call our routes/render/changePage.Now if we return
{}
on0.4.163
, the clientside hook never runs. Returningfalse
, Vike mentions it would like a plain obj, null, etc. But clientside now runs though, but thepageContext
once we hitonBeforeRender
is missing some of the original passToClient values (env values we pass from express).pageContextFromServer
now has serverSideError/isServerSideError keys.errorWhileRendering: "[vike][Error] The pageContext object couldn't be fetched from the server as an error occurred on the server-side. Check your server logs."
+config.js
has the correctmeta
setup also.Beta Was this translation helpful? Give feedback.
All reactions