@netlify/vite-plugin-react-router couldn't complete build process with react-router v7

Hi,

I have been trying all sorts of solutions to get my deployment working locally and on the Netlify domain, but the build failed to complete the build process.

DOMAIN: https://analytics-logging.netlify.app/
NODE-VERSION: v20.19.2

Error Below:

Jun 27, 10:23:56 PM: 4259141a INFO   [GET] https://685f0bc37c59840008a9f9ef--analytics-logging.netlify.app/
Jun 27, 10:23:56 PM: 4259141a ERROR  TypeError: Cannot read properties of undefined (reading 'manifestPath')
    at requestHandler (/var/task/node_modules/@netlify/vite-plugin-react-router/node_modules/react-router/dist/development/index.js:11020:29)
    at Module.<anonymous> (file:///var/task/node_modules/@netlify/vite-plugin-react-router/dist/index.mjs:14:30)
    at async bm (file:///var/task/___netlify-bootstrap.mjs:3:109468)
    at async Runtime.handler (file:///var/task/___netlify-bootstrap.mjs:3:109139)
    at async Runtime.handleOnceStreaming (file:///var/runtime/index.mjs:1238:26)

The page keeps showing an Internal error on https://analytics-logging.netlify.app/

On my local machine, I can see this error below.

Netlify Build Complete                                        
────────────────────────────────────────────────────────────────
​
(Netlify Build completed in 3.7s)

⬥ Static server listening to 3999

   ╭─────────────────────── ⬥  ────────────────────────╮
   │                                                   │
   │   Local dev server ready: http://localhost:8888   │
   │                                                   │
   ╰───────────────────────────────────────────────────╯

Request from ::1: GET /

⬥ Function react-router-server has returned an error: Cannot find module '/Users/xxx/Documents/analytics/.netlify/functions-serve/.unzipped/react-router-server/node_modules/react-router/dist/development/index.mjs' imported from /Users/xxx/Documents/analytics/.netlify/functions-serve/.unzipped/react-router-server/.netlify/v1/functions/react-router-server.mjs