next.jsnpm-installvercelpnpm

Getting error when deploying to vercel ERR_PNPM_NO_MATCHING_VERSION


When running the vercel command to deploy my app I'm getting an error:

 ERR_PNPM_NO_MATCHING_VERSION  No matching version found for @tanstack/virtual-core@3.10.0
This error happened while installing the dependencies of nextra@2.13.4
 at @headlessui/react@1.7.19
 at @tanstack/react-virtual@3.10.0
The latest release of @tanstack/virtual-core is "3.9.0".
Other releases are:
  * alpha: 3.0.0-alpha.2
  * beta: 3.0.0-beta.68
If you need the full list of all 79 published versions run "$ pnpm view @tanstack/virtual-core versions".
Error: Command "pnpm install" exited with 1

As you can probaly tell be the error I am deploying a Next.js pages app with Next to vercel. I am not getting an error when installing locally. Here is my package.json:

{
  "name": "nextra-docs-template",
  "version": "0.0.1",
  "description": "Nextra docs template",
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/shuding/nextra-docs-template.git"
  },
  "author": "Shu Ding <g@shud.in>",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/shuding/nextra-docs-template/issues"
  },
  "homepage": "https://github.com/shuding/nextra-docs-template#readme",
  "dependencies": {
    "next": "14.2.5",
    "nextra": "latest",
    "nextra-theme-docs": "latest",
    "react": "^18.3.0",
    "react-dom": "^18.3.0"
  },
  "devDependencies": {
    "@types/node": "22.1.0",
    "typescript": "5.5.4"
  }
}

An my custom vercel settings: changed settings

I have tried installing the latest version of virtual core still no luck. Any way I can fix this.


Solution

  • One potential solution would be to set the following in your package.json:

    "overrides": {
            "@tanstack/react-virtual": "3.9.0"
    },
    

    I had the same issue, rolling back to version 2.1.1 of @headless-ui/react in my project's package.json solved the issue for me. Since one of your dependency's, Nextra, depends on @headlessui-react, this appears to be causing the issue.

    Until this is fixed, here is the issue on the TanStack GitHub repo, plus here's the issue in the Headless UI repo, which contain more details on what may be causing the error. Hopefully that helps.