vercel: Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/var/task/apps/remix/build

There is already an issue that was supposedly fixed, however im now getting runtime issues again all of a sudden.

I made no changes to my app code but all new deploys are failing in runtime:

2023-12-01T10:15:03.674Z	undefined	ERROR	Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/var/task/apps/remix/build/build-nodejs-eyJydW50aW1lIjoibm9kZWpzIn0.js' imported from /var/task/apps/remix/build/server-build-nodejs-eyJydW50aW1lIjoibm9kZWpzIn0.mjs
    at new NodeError (node:internal/errors:405:5)
    at finalizeResolution (node:internal/modules/esm/resolve:332:11)
    at moduleResolve (node:internal/modules/esm/resolve:995:10)
    at moduleResolveWithNodePath (node:internal/modules/esm/resolve:939:12)
    at defaultResolve (node:internal/modules/esm/resolve:1181:79)
    at nextResolve (node:internal/modules/esm/loader:163:28)
    at ESMLoader.resolve (node:internal/modules/esm/loader:835:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:77:40)
    at link (node:internal/modules/esm/module_job:76:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}
INIT_REPORT Init Duration: 284.57 ms	Phase: invoke	Status: error	Error Type: Runtime.ExitError
Error: Runtime exited without providing a reason

I’ve reverted my entire codebase back to a commit that I know for sure worked and made sure the settings in vercel were exactly the same (they haven’t changed) and if I redeploy that commit, it still errors in runtime.

I’m using version 2.2.0 for vercel/remix + all remix packages, which I know work on Vercel as it was running yesterday.

Fortunately rolling back to a previous deploy still works? but pushing the exact same commit doesn’t, so it seems like it’s something to do with a change in Vercel’s build process?

About this issue

  • Original URL
  • State: open
  • Created 7 months ago
  • Reactions: 7
  • Comments: 17 (3 by maintainers)

Most upvoted comments

If anyone in this thread is still having issues, I recommend switching to Remix + Vite. See the docs page for how to configure the Vercel preset.

I too am getting this. Since a repo hasn’t been posted yet:

@Disorrder Do you have a remix.config.js file? If so, delete it.