Remix - Have there been changes on how Vercel handled it between February 13 and February 22 - getLoadContext ignored or ignored server.js? #1596
-
SummaryI have run out of options. Between February 13 and today, February 22 of 2023, there seems to be a change in how Vercel handled remix apps. (Or at least that's a hunch that I have). I'm currently using Remix 1.13.0 and I am using Even if I git push the same exact build! I don't remember making any changes either to remix or to vercel. It is working locally fine! Here's my package.json
Here's my remix.config.js /**
* @type {import('@remix-run/dev').AppConfig}
*/
module.exports = {
cacheDirectory: "./node_modules/.cache/remix",
ignoredRouteFiles: ["**/.*", "**/*.css", "**/*.test.{js,jsx,ts,tsx}"],
devServerPort: 8002,
serverBuildTarget:
process.env.NODE_ENV === "development" ? "node-cjs" : "vercel",
// When running locally in development mode, we use the built in remix
// server. This does not understand the vercel lambda module format,
// so we default back to the standard build output.
server: process.env.NODE_ENV === "development" ? undefined : "./server.js",
serverDependenciesToBundle: [/^validator*/],
}; And here's the server.js import { createRequestHandler } from "@remix-run/vercel";
import * as build from "@remix-run/dev/server-build";
import { dispatchWithContext } from "@server/config";
export default createRequestHandler({
build,
mode: process.env.NODE_ENV,
getLoadContext() {
return {
dispatch: dispatchWithContext({}),
};
},
}); This is very worrying, as it's getting my production site impacted. I had to use the instant rollback feature to February 13 as it seems that before that it wasn't affected. I have tried using I've already spent 13+ hours debugging. Do you have any ideas? P.S:
Additional informationI've already seen several questions popping up. ExampleNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hi @superjose, I am sorry that this is happening to you. Firstly, if you need an immediate workaround, set the environment variable To answer your question, yes, there have been some quite heavy changes to how Remix projects are deployed, and your configuration was unfortunately overlooked. I apologize for that, and I have a plan for fixing your setup and I will be prioritizing that. Stay tuned, I'll have an update for you soon. |
Beta Was this translation helpful? Give feedback.
Hi @superjose, I am sorry that this is happening to you.
Firstly, if you need an immediate workaround, set the environment variable
VERCEL_CLI_VERSION
with a value of[email protected]
on your deployment.To answer your question, yes, there have been some quite heavy changes to how Remix projects are deployed, and your configuration was unfortunately overlooked. I apologize for that, and I have a plan for fixing your setup and I will be prioritizing that. Stay tuned, I'll have an update for you soon.