vercel: Failed runtime on a fresh Remix + Bun setup

Repro Steps:

While the deployment succeeds, the site doesn’t load as there’s 500 server error

CleanShot 2023-09-12 at 09 14 21@2x

Logs

2023-09-12T23:15:51.918Z	undefined	ERROR	Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/var/task/build/build-nodejs-eyJydW50aW1lIjoibm9kZWpzIn0.js' imported from /var/task/build/server-build-nodejs-eyJydW50aW1lIjoibm9kZWpzIn0.mjs
    at new NodeError (node:internal/errors:405:5)
    at finalizeResolution (node:internal/modules/esm/resolve:329:11)
    at moduleResolve (node:internal/modules/esm/resolve:992:10)
    at moduleResolveWithNodePath (node:internal/modules/esm/resolve:936:12)
    at defaultResolve (node:internal/modules/esm/resolve:1178: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'
}
RequestId: d3880205-6853-4d3a-84a8-b87fb9ed227b Error: Runtime exited with error: exit status 1
Runtime.ExitError

About this issue

  • Original URL
  • State: closed
  • Created 10 months ago
  • Reactions: 4
  • Comments: 23 (1 by maintainers)

Most upvoted comments

I’m taking a break from trying to deploy remix to vercel until things get stable. When I have time to give cloudflare a try and see how it goes.

@TooTallNate this issue is ongoing, could you please re-open this issue? or is it best to open a new one with the same description?

Have one here https://github.com/vercel/vercel/issues/10893

@JClackett

You can try adding an environment variable with the name VERCEL_CLI_VERSION and a value vercel@32.5.6.

Yep, have set the env and now builds are running again 😃 will just pray a newer version of the cli works/vercel takes a look at my issue

@JClackett You can try adding an environment variable with the name VERCEL_CLI_VERSION and a value vercel@32.5.6.

I managed to get it to work but I remember seeing intermittent runtime errors which made it seem Remix deploy wasn’t very stable. However I took a break from the project so not sure what the current status is of deploying latest Remix on Vercel

Also Remix v2 doesn’t seem to work on Vercel. Try a default Remix app using bunx create-remix. Deployment succeeded but there’s a runtime error

file:///var/task/build/server-build-nodejs-eyJydW50aW1lIjoibm9kZWpzIn0.mjs:2
  AbortController as NodeAbortController,
  ^^^^^^^^^^^^^^^
SyntaxError: Named export 'AbortController' not found. The requested module '@remix-run/node' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@remix-run/node';

    at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:190:5)
RequestId: c1fb58ba-f5be-4011-a60e-60bd87b26014 Error: Runtime exited with error: exit status 1
Runtime.ExitError

Any clue how to fix?

Remix v2 pre release will most likely not work. The Vercel team work hard to make it work with Vercel platform.

Please follow this issue here for v2 support https://github.com/vercel/remix/issues/53

I found this issue on https://ovio.org/projects and would love to contribute! [add other relevant info about you]

I actually seem to be hitting this also! Mine isn’t a fresh build though, it was an existing working vercel deployed project with Remix that I’d simply replaced pnpm for bun as the package manager. I have the exact same issue as the one in description