Option 1

Set VERCEL_CLI_VERSION environment variable to the previous CLI verison [email protected].

e.g. [email protected]

Option 2

We are locking this thread now to avoid confusion. As a next step:

We have an update from our engineer that may fix your issue and allow you to remove the CLI variable:
tsconfig.json with "module": "esnext" (or "module": "nodenext") must also have package.json with "type": "module".

If you run into a problem, it will likely be at runtime and look something like:

ReferenceError: require is not defined in ES module scope, you can use import instead

If you want to continue using CommonJS instead of ES Modules, the solution would be to update your tsconfig.json file with "module": "commonjs".

Also note that TypeScript will allow you to mix CJS and ESM, however Node.js will not. So you cannot use require() and import() in the same file, and you cannot use export default and module.exports in the same file.

If you are still facing issue with above configuration, please reach out to Vercel Support with following information:

  • contents of package.json
  • contents tsconfig.json
  • the runtime error message (we can find this if you provide deployment url)
  • the contents of the file that failed (the file will be mentioned in the error message)

If you have set any Environment variable to use previous version of Vercel CLI, please ensure you remove it to get future updates of our Vercel builder. Thank you!

Refer: https://github.com/orgs/vercel/discussions/1225