Skip to content

TypeError: Cannot read properties of undefined (reading 'cliBinaryExists') #8576

@simPod

Description

@simPod

Is there an existing issue for this?

How do you use Sentry?

Self-hosted/on-premise

Which SDK are you using?

@sentry/nextjs

SDK Version

13.4.9

Framework Version

18.2.0

Link to Sentry event

No response

SDK Setup

Sentry.init({
  dsn: SentryDsn,
  environment: process.env.NEXT_PUBLIC_ENVIRONMENT,
  integrations: [new CaptureConsole({ levels: ['assert', 'error', 'warn'] })],
  release: process.env.NEXT_PUBLIC_RELEASE,
  sendDefaultPii: true,
  tracesSampleRate: 0.1,
});

Steps to Reproduce

image

I use import { withSentryConfig } from '@sentry/nextjs';

and

const nextConfig = {
  reactStrictMode: true,
  // Disable sentry plugin
  // https://github.com/getsentry/sentry-javascript/blob/115b0f3c07efa755c8f90d32cfd1783a35451eba/packages/nextjs/src/config/webpack.ts#L82-84
  sentry: {
    disableClientWebpackPlugin: true,
    disableServerWebpackPlugin: true,
  },

next build

Expected Result

No errors

Actual Result

During build

yarn run build
- warn No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
- info Linting and checking validity of types...
- warn The Next.js plugin was not detected in your ESLint configuration. See https://nextjs.org/docs/basic-features/eslint#migrating-existing-config
- info Creating an optimized production build...
> Build error occurred
TypeError: Cannot read properties of undefined (reading 'cliBinaryExists')
    at shouldEnableWebpackPlugin (/builds/project/.yarn/__virtual__/@sentry-nextjs-virtual-8ab386e88f/4/build-cache/yarn/cache/@sentry-nextjs-npm-7.59.2-4ce32cadc9-10c0.zip/node_modules/@sentry/nextjs/cjs/config/webpack.js:764:28)
    at Object.newWebpackFunction [as webpack] (/builds/project/.yarn/__virtual__/@sentry-nextjs-virtual-8ab386e88f/4/build-cache/yarn/cache/@sentry-nextjs-npm-7.59.2-4ce32cadc9-10c0.zip/node_modules/@sentry/nextjs/cjs/config/webpack.js:285:9)
    at getBaseWebpackConfig (/builds/project/.yarn/__virtual__/next-virtual-598703b69f/4/build-cache/yarn/cache/next-npm-13.4.9-5c37513773-10c0.zip/node_modules/next/dist/build/webpack-config.js:2152:32)
    at async Promise.all (index 1)
    at async Span.traceAsyncFn (/builds/project/.yarn/__virtual__/next-virtual-598703b69f/4/build-cache/yarn/cache/next-npm-13.4.9-5c37513773-10c0.zip/node_modules/next/dist/trace/trace.js:103:20)
    at async webpackBuildImpl (/builds/project/.yarn/__virtual__/next-virtual-598703b69f/4/build-cache/yarn/cache/next-npm-13.4.9-5c37513773-10c0.zip/node_modules/next/dist/build/webpack-build/impl.js:133:21)
    at async webpackBuild (/builds/project/.yarn/__virtual__/next-virtual-598703b69f/4/build-cache/yarn/cache/next-npm-13.4.9-5c37513773-10c0.zip/node_modules/next/dist/build/webpack-build/index.js:137:16)
    at async /builds/project/.yarn/__virtual__/next-virtual-598703b69f/4/build-cache/yarn/cache/next-npm-13.4.9-5c37513773-10c0.zip/node_modules/next/dist/build/index.js:584:123
    at async Span.traceAsyncFn (/builds/project/.yarn/__virtual__/next-virtual-598703b69f/4/build-cache/yarn/cache/next-npm-13.4.9-5c37513773-10c0.zip/node_modules/next/dist/trace/trace.js:103:20)
    at async build (/builds/project/.yarn/__virtual__/next-virtual-598703b69f/4/build-cache/yarn/cache/next-npm-13.4.9-5c37513773-10c0.zip/node_modules/next/dist/build/index.js:145:29)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions