Deploying react router v7 to cloudflare pages not working? #12998
-
Hi everyone! I recently tried deploying my site to cloudflare pages. I didn’t change my vite config, I just used the remix option on cloudflare but loading the site on any page results in a 404. Does cloudflare pages on support static/spa applications for react router v7? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 1 reply
-
Noticed the templates repo, which includes an example for cloudflare: https://github.com/remix-run/react-router-templates/tree/main/cloudflare |
Beta Was this translation helpful? Give feedback.
-
This repo template seems only works for Cloudflare Workers but not Pages. Do you get it working for Pages? |
Beta Was this translation helpful? Give feedback.
-
I have this same issue |
Beta Was this translation helpful? Give feedback.
-
the best way I found was creating a remix project for cloudflare pages and then following the upgrade guide to make it work on react-router v7 |
Beta Was this translation helpful? Give feedback.
-
Hi! I just made a template that you can use! https://github.com/Xazu001/react-router-cf |
Beta Was this translation helpful? Give feedback.
-
FYI Cloudflare workers now can do the same as pages and they actually recommend using workers instead of pages. |
Beta Was this translation helpful? Give feedback.
Noticed the templates repo, which includes an example for cloudflare: https://github.com/remix-run/react-router-templates/tree/main/cloudflare