I have migrated my remix app into new “react router” and i am facing obvious trubles
I am recieving this
Error: Invalid request method "OPTIONS"
at getInternalRouterError (/var/task/sotka-remix/node_modules/@remix-run/node/node_modules/@remix-run/server-runtime/node_modules/@remix-run/router/dist/router.cjs.js:5192:59)
at Object.query (/var/task/sotka-remix/node_modules/@remix-run/node/node_modules/@remix-run/server-runtime/node_modules/@remix-run/router/dist/router.cjs.js:3755:19)
at handleDocumentRequest (/var/task/sotka-remix/node_modules/@remix-run/node/node_modules/@remix-run/server-runtime/
what is wrong about this stack is that @remix-run should not occure in react router 7 app
Considering you’ve migrated to React Router I agree its strange that @remix-run is appearing in the stack trace. This probably means that some Remix dependencies are still present or that the refactor was incomplete.
If its working locally but throwing errors when deployed there’s a chance that the client is out of sync with the backend. If this theory is correct enabling Skew Protection could help.
I’m not an expert on these specific frameworks/libraries but I think the issue is that the server is not able to properly handle the OPTIONS request method. If I recall correctly these are usually sent as a preflight request for CORS. Usually we shouldn’t have to dig into this level of detail but if you’re still having issues maybe consider reviewing whether middleware is appropriately handling OPTIONS requests and CORS.
It could be worth looking for example repos that already use Remix with React Router to look for implementation discrepancies.
Considering you’ve migrated to React Router I agree its strange that @remix-run is appearing in the stack trace. This probably means that some Remix dependencies are still present or that the refactor was incomplete.
no, it does not. it is about how Vercel made remix integration. Spoiler: via fork
I have removed my old project and recreated one to make sure it is still not working, but another way: It actually is shown as Vite project and nothing is served at all
One more thing about remix and react router. Thing is remix IS now react router (or RR is Remix). Anyway, update is coming (pre release now) and Vercel is not supporting niether
So, I need more info about when/whether Vercel going to support new Remix(RR7)
We don’t currently support React Router v7 as a framework (aka new Remix), but we do support it as a library. I’m going to combine this discussion with this one where we’re tracking adding support. Thanks for the ping.