I originally posted this on the GitHub discussion forum yesterday ( https://github.com/remix-run/remix/discussions/9995 ), but then realized this morning that Discord seems to have effectively replaced that medium.
So I was at 2.9.1 of all Remix components. @remix-run/express depends on express, which was at 4.19.2. All was well. Some security vulnerabilities appeared in npm audit, all of which were dependent modules of express (send, body-parser, path-to-regexp). I updated express by itself to 4.21.0. npm audit passed fine then, and my app still worked fine.
Then I updated the @remix-run/node and @remix-run/react components to 2.12.0. All was still well with my app. The @remix-run/express component still was using @remix-run/[email protected] at this point, however.
Lastly, I updated @remix-run/express, and that's when my app got into an endless loop at startup with this error on the dev console:
Initial URL (undefined) does not match URL at time of hydration (/), reloading page...
What changes between @remix-run/express 2.9.1 and 2.12.0 might require changes in my code? The only function I use from that package directly is in my express startup script, which calls createRequestHandler() like so:
function getRequestHandler(build) { function getLoadContext(_, res) { return { cspNonce: res.locals.cspNonce } } return createRequestHandler({ build, mode: MODE, getLoadContext }) }