Using Remix / React Router 7 with the new CloudFlare Vite plugin

Has anyone been able to get a working local Pages development environment with Remix / React Router 7 and the new CloudFlare Vite plugin for Vite 6 leveraging the Environments API? For quite a while now, I've been experimenting with different ways to bring my local development environment more inline with the deployments to the Pages platform (i.e. to properly simulate things like _middleware and _headers). One pain point has always been the lack of HMR / love reloading during the development loop. After coming across this blog post from last month, you could say that I was more than excited to try it out! https://blog.cloudflare.com/introducing-the-cloudflare-vite-plugin/ Aside from the ongoing merge of Remix and React Router 7 causing countless headaches, most scaffolds and examples are only for pure Workers and not Pages projects. At the moment, I'm able to get my Pages Vite development server to start, but no content is served from the simulated worker, constantly returning empty responses with no logs. I am yet to dive deeper into the internals of how the createPagesFunctionHandler from @remix-run/cloudflare-pages interplays with the new Vite plugin compared to cloudflareDevProxyVitePlugin, but was curious if anyone else has had any success in this space?
The Cloudflare Blog
“Just use Vite”… with the Workers runtime
The Cloudflare Vite plugin integrates Vite, one of the most popular build tools for web development, with the Workers runtime. Today, we are announcing the 1.0 release and official support for React Router v7.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?