Access programatic prerender initialPageContext in the onBeforeRender hook #574
-
I'm trying to build something akin to the Here is the prerender script I'm using for reference: const { ApolloClient, HttpLink, InMemoryCache } = require('@apollo/client')
const fetch = require('cross-fetch')
const { prerender } = require('vite-plugin-ssr/prerender')
function makeApolloClient() {
const apolloClient = new ApolloClient({
ssrMode: true,
link: new HttpLink({
uri: 'https://countries.trevorblades.com',
fetch
}),
cache: new InMemoryCache()
})
return apolloClient
}
const apolloClient = makeApolloClient()
const pageContextInit = {
apolloClient
}
prerender({
pageContextInit
}) Is this expected behavior, and is there a way to work around it? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It was bug which just got fixed, see #576. In case your company is up for it: https://github.com/sponsors/brillout. |
Beta Was this translation helpful? Give feedback.
It was bug which just got fixed, see #576.
In case your company is up for it: https://github.com/sponsors/brillout.