Skip to content

Can't install @sentry/nextjs in next 11 project #3700

Closed
@pyprism

Description

@pyprism

Package + Version

  • @sentry/browser
  • @sentry/node
  • raven-js
  • raven-node (raven for node)
  • other:

Version:

@sentry/nextjs

Description

When I tried to install latest @sentry/nextjs package I got this error:

npm install --save @sentry/nextjs
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: ***@0.1.0
npm ERR! Found: next@11.0.0
npm ERR! node_modules/next
npm ERR!   next@"11.0.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer next@"^10.0.8" from @sentry/nextjs@6.7.1
npm ERR! node_modules/@sentry/nextjs
npm ERR!   @sentry/nextjs@"*" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /home/prism/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/prism/.npm/_logs/2021-06-17T17_56_44_854Z-debug.log

here is my project package.json

{
  "name": "***",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "size": "ANALYZE=true next build",
    "start": "next start -p 4321"
  },
  "dependencies": {
    "@next/bundle-analyzer": "^11.0.0",
    "axios": "^0.21.1",
    "escape-string-regexp": "^5.0.0",
    "luxon": "^1.27.0",
    "next": "11.0.0",
    "next-pwa": "^5.2.21",
    "next-seo": "^4.25.1",
    "react": "17.0.2",
    "react-dom": "17.0.2",
    "react-responsive-carousel": "^3.2.18"
  },
  "devDependencies": {
    "@babel/core": "^7.14.6",
    "@babel/preset-env": "^7.14.5",
    "bulma": "^0.9.2",
    "sass": "^1.35.1",
    "webpack": "^5.39.0"
  }
}

and next.config.js content:

const withPWA = require('next-pwa');
const path = require('path');

const withBundleAnalyzer = require('@next/bundle-analyzer')({
    enabled: process.env.ANALYZE === 'true',
})

let domain = '***';


let nextConfig = {
    target: "serverless",
    sassOptions: {
        includePaths: [path.join(__dirname, 'styles')],
    },
    env: {
        domain: domain,
    },
    images: {
        domains: ['***'],
    },
    pwa: {
        dest: 'public',
    }
}


if(process.env.DEBUG) {
    domain = 'http://localhost:8000';
    module.exports = withBundleAnalyzer({
        env: {
            domain: domain,
        },
        images: {
            domains: ['**'],
        },

    })
}

module.exports = withPWA(nextConfig);

Metadata

Metadata

Assignees

Labels

Package: nextjsIssues related to the Sentry Nextjs SDK

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions