DEV Community

Cover image for Fixing `ERR_INVALID_THIS` on Vercel by Switching from pnpm to Bun
阿豪
阿豪

Posted on

Fixing `ERR_INVALID_THIS` on Vercel by Switching from pnpm to Bun

When deploying on Vercel with Node.js 20+, I ran into a frustrating error during pnpm install:


(ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
Enter fullscreen mode Exit fullscreen mode

No matter what I tried, I couldn’t get rid of it. The only workaround was to fall back to Node.js 18, but Vercel is deprecating Node 18 support soon.

After exhausting all the solutions I could find, I decided to try switching to Bun.

Running:

bun install
Enter fullscreen mode Exit fullscreen mode

worked perfectly — no more errors! 🎉

Thanks to Bun, my builds are running smoothly again. It truly saved the day. 🙌

Top comments (0)