Issue with pnpm v10

Hi all. I’m trying to make Vercel work with latest pnpm and facing some issue with it.

I’d like to use recent pnpm version (v10.22 at the moment) due to added support for “trustPolicy”. Previously with pnpm v9, vercel builds worked as expected. Now it fails with following stack trace:

Running "vercel build"
Vercel CLI 48.9.1
WARN! Warning: Could not enable corepack because package.json is missing "packageManager" property
Installing dependencies...
 WARN  Ignoring not compatible lockfile at /vercel/path0/app/pnpm-lock.yaml
node_modules/.pnpm                       |  WARN  Ignoring not compatible lockfile at /vercel/path0/app/node_modules/.pnpm/lock.yaml
 WARN  GET https://registry.npmjs.org/@vitejs%2Fplugin-vue error (ERR_INVALID_THIS). Will retry in 1 minute. 1 retries left.
 WARN  GET https://registry.npmjs.org/@vitest%2Fexpect error (ERR_INVALID_THIS). Will retry in 1 minute. 1 retries left.
 WARN  GET https://registry.npmjs.org/@vue%2Ftest-utils error (ERR_INVALID_THIS). Will retry in 1 minute. 1 retries left.
 WARN  GET https://registry.npmjs.org/@playwright%2Ftest error (ERR_INVALID_THIS). Will retry in 1 minute. 1 retries left.
 WARN  GET https://registry.npmjs.org/chromatic error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 ERR_PNPM_META_FETCH_FAIL  GET https://registry.npmjs.org/@eslint%2Fjs: Value of "this" must be of type URLSearchParams
 WARN  GET https://registry.npmjs.org/eslint error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/eslint-config-prettier error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/eslint-import-resolver-typescript error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/eslint-plugin-import error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/eslint-plugin-jest-dom error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/eslint-plugin-storybook error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/eslint-plugin-testing-library error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/eslint-plugin-vue error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/eslint-plugin-vuejs-accessibility error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/globals error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/happy-dom error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/husky error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/lint-staged error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/msw error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/npm-run-all error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
Error: Command "pnpm install" exited with 1


Basically front end application is located in ./app directory. Files package.json, pnpm-lock.yaml and pnpm-workspace.yaml present. packageManager inside package.json is set to “pnpm@10.22.0+sha512.bf049efe995b28f527fd2b41ae0474ce29186f7edcb3bf545087bd61fbbebb2bf75362d1307fda09c2d288e1e499787ac12d4fcb617a974718a6051f2eee741c”. Environment variable ENABLE_EXPERIMENTAL_COREPACK is set to 1.

Hey, @akarmes! Welcome :waving_hand:

You’re seeing that warning because Vercel wants the packageManager field defined in your root package.json, so make sure you have something like "packageManager": "pnpm@10.22.0". If that still causes issues, try pinning to an earlier pnpm v10 release. v10 is still pretty new, and some versions are a bit finicky in Vercel’s build environment.

It can also help to regenerate your lockfile: delete pnpm-lock.yaml and node_modules, then run a fresh pnpm install locally so the lockfile matches the version you’re declaring.

If you need things working right away, sticking with pnpm v9 is the safer option for now. v10’s new features (including trustPolicy) are nice, but if they’re blocking deploys, v9 tends to be more stable on Vercel at the moment.

Thank you for taking your time to answer me. Thing is - it’s a multi language repository that lots of teams are working on. I’m unwilling to add root package.json into repo with Go, Python, C, Terraform, Helm and others just for the sake of having Vercel deployment in one of UI apps. Vercel project is configured with Root Directory (path is like “ui-app”) and that directory has root package.json with defined packageManager . Recreating pnpm-lock.yaml doesn’t work work, as both pnpm v9 and v10 has the same lockfile version. I guess I expect Vercel to respect Root Directory and act accordingly.

1 Like

I am having this exact issue since yesterday. I can only get my website to “build” with the Bun runtime only but even with that, my website doesn’t work anymore on Vercel and just loads infinitely.

1 Like

Anyway, I ended up recreating Vercel project just to force it to use pnpm v10, as Vercel looks at project creation date to decide between v9 and v10. Quite ridiculous, but it works.

1 Like

Removing ENABLE_EXPERIMENTAL_COREPACK from the environment variables resolved the error.

1 Like

Thanks for coming back with what worked for you!

I’ll share this thread with our product team as feedback :folded_hands:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.