I'm using Next js 15 and React 19 for a web app and I'm having issue with installing Sentry into my project. While trying to install sentry I get the following error:
◇ Installation failed.
│
■ Encountered the following error during installation:
│
│ Error: Command failed: npm add @sentry/nextjs@^9
│ npm error code ERESOLVE
│ npm error ERESOLVE could not resolve
│ npm error
│ npm error While resolving: sanity-plugin-markdown@5.0.0
│ npm error Found: react@19.0.0
│ npm error node_modules/react
│ npm error peer react@">=16.8.0" from @dnd-kit/accessibility@3.1.1
│ npm error node_modules/@dnd-kit/accessibility
│ npm error @dnd-kit/accessibility@"^3.1.1" from @dnd-kit/core@6.3.1
│ npm error node_modules/@dnd-kit/core
│ npm error peer @dnd-kit/core@"^6.0.6" from @dnd-kit/modifiers@6.0.1
│ npm error node_modules/@dnd-kit/modifiers
│ npm error @dnd-kit/modifiers@"^6.0.0" from sanity@3.76.1
│ npm error node_modules/sanity
│ npm error 2 more (@dnd-kit/sortable, sanity)
│ npm error peer react@">=16.8.0" from @dnd-kit/core@6.3.1
│ npm error node_modules/@dnd-kit/core
│ npm error peer @dnd-kit/core@"^6.0.6" from @dnd-kit/modifiers@6.0.1
│ npm error node_modules/@dnd-kit/modifiers
│ npm error @dnd-kit/modifiers@"^6.0.0" from sanity@3.76.1
│ npm error node_modules/sanity
│ npm error peer sanity@"^3.75.1" from next-sanity@9.8.58
│ npm error node_modules/next-sanity
│ npm error 2 more (sanity-plugin-markdown, the root project)
│ npm error peer @dnd-kit/core@"^6.0.7" from @dnd-kit/sortable@7.0.2
│ npm error node_modules/@dnd-kit/sortable
│ npm error @dnd-kit/sortable@"^7.0.1" from sanity@3.76.1
│ npm error node_modules/sanity
│ npm error peer sanity@"^3.75.1" from next-sanity@9.8.58
│ npm error node_modules/next-sanity
│ npm error 2 more (sanity-plugin-markdown, the root project)
│ npm error 1 more (sanity)
│ npm error 72 more (@dnd-kit/modifiers, @dnd-kit/sortable, ...)
│ npm error
│ npm error Could not resolve dependency:
│ npm error peer react@"^18.3" from sanity-plugin-markdown@5.0.0
│ npm error node_modules/sanity-plugin-markdown
│ npm error sanity-plugin-markdown@"^5.0.0" from the root project
│ npm error
│ npm error Conflicting peer dependency: react@18.3.1
│ npm error node_modules/react
│ npm error peer react@"^18.3" from sanity-plugin-markdown@5.0.0
│ npm error node_modules/sanity-plugin-markdown
│ npm error sanity-plugin-markdown@"^5.0.0" from the root project
│ npm error
│ npm error Fix the upstream dependency conflict, or retry
│ npm error this command with --force or --legacy-peer-deps
│ npm error to accept an incorrect (and potentially broken) dependency resolution.
I checked if sentry is not compatible with react 19, and it is compatible
The conflicting peer dependencies likely come from somewhere else than Sentry in your project. You should be able to manually install the @sentry/nextjs
package and then rerun the wizard and then it will ask you whether you want to install/update it.
Or you can simply re-run the wizard with the --force-install
flag, which should bypass the peer dependency check.