#react

1 messages · Page 1 of 1 (latest)

trail lakeBOT
#

Hi @hollow ore. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

This error is related to a known issue with Next.js 15 and its use of a release candidate (RC) version of React 19. The problem occurs when trying to install packages that have peer dependencies on specific React versions.

The error you're encountering is due to a conflict between the React version installed by Next.js 15 (which is a release candidate of React 19) and the peer dependency requirements of @heroicons/react, which expects React version 16 or higher.

There are a few potential workarounds for this issue:

  1. Use the --legacy-peer-deps flag when installing packages:

    npm install --legacy-peer-deps @heroicons/react
    
  2. Add React version overrides to your package.json:

    "overrides": {
      "@heroicons/react": {
        "react": "19.0.0-rc-02c0e824-20241028",
        "react-dom": "19.0.0-rc-02c0e824-20241028"
      }
    }
    
  3. Downgrade React to version 18 (though this may cause other issues with Next.js 15).

These workarounds are mentioned in the GitHub issue about installing packages with Next.js 15 (https://github.com/vercel/next.js/issues/72026).

It's worth noting that this is a widespread issue affecting many packages, not just @heroicons/react. The Next.js team is aware of the problem, and it may be resolved in future updates.

For now, using one of the workarounds above should allow you to install the package, but be aware that there might be compatibility issues due to the use of a release candidate version of React.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@hollow ore Kapa.ai is still learning and improving, please let me know how I did by reacting below.