#Upgrading to React Router 7.2.0 broke my server build—need help!

1 messages · Page 1 of 1 (latest)

summer plover
#

Hey everyone, I’m stuck and could really use some help. I upgraded from React Router 7.1 to 7.2.0 because I desperately need that sweet href utility for type-safe links (e.g., href("/resources/user/:id", { id: "123" })). I figured it’d be a smooth upgrade—updated all the related packages like @react-router/dev too—but now my build is a mess. The client side compiles fine with Vite, but the server build keeps crashing with this vague error: Cannot read properties of undefined (reading 'file') in the React Router Vite plugin.

This shouldn’t be a breaking change, right? I’m using the same Vite version (5.4.14), and I only wanted the href feature—not a complete rebuild disaster! It’s driving me nuts because I can’t move forward without it, and I’ve lost hours trying to debug this. Has anyone else hit this wall upgrading to 7.2.0? What did you do to fix it? I’d owe you big time for any pointers—thanks so much in advance!

halcyon glade