Cloudflare Worker x Route Pre-rendering
I have the following setup:
Page:
Config:
Issue:
When running locally this works as expected and routing to the page works fine. However when I run a build and subsequent
wrangler dev things start to behave strange;
If I visit the example page directly it correctly serves the page from the pre-rendered build.
Whereas if I land on a different page then route to the example page the app then attempts to run getWorkData on the client which fails. I've tried all sorts of things but no bueno. Can anyone guide me as to why getWorkData ever is called on client after pre-rendering? Don't understand why if I'm running SSG and I can see that the data is correctly output in the build folder / correctly served when visited why does the fetch still get called on subsequent routes? Is there a way to force pre-rendered pages to only ever retrieve data from the generated build?1 Reply
Start only uses SSR for the initial page load, whether that's prerendered or dynamic. Subsequent navigations will happen on the client, though since you're using
use server that should still work since the client should be running your cf worker