I had the same issue, I'm using react-router v7, which is developed by the Remix team.
react-router
https://github.com/remix-run/react-router/issues/13516
I am using Vite, this plugin was helpful https://github.com/ChromeDevTools/vite-plugin-devtools-json