sentry-javascript: SentryWebpackPlugin.cliBinaryExists is not a function
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
SDK Version
7.62.0
Framework Version
Next 13.2.1
Link to Sentry event
No response
SDK Setup
No response
Steps to Reproduce
- I am facing error
SentryWebpackPlugin.cliBinaryExists is not a functionwhen running my next js app with nx monorepo
This is my next config
const {withNx} = require('@nrwl/next/plugins/with-nx')
const {withSentryConfig} = require('@sentry/nextjs')
const path = require('path')
const isOnDesktop = process.env['NX_DESKTOP'] === 'true'
const firebaseAuthDomain = process.env['NX_FIREBASE_AUTH_DOMAIN']
const isAnalyzingBundle = process.env['ANALYZE'] === 'true'
/**
* Stolen from https://stackoverflow.com/questions/10776600/testing-for-equality-of-regular-expressions
*/
const regexEqual = (x, y) => {
return (
x instanceof RegExp &&
y instanceof RegExp &&
x.source === y.source &&
x.global === y.global &&
x.ignoreCase === y.ignoreCase &&
x.multiline === y.multiline
)
}
const iconFamiliesBeforeUrlChange = [
'streamline-bold',
'streamline-light',
'streamline-micro-bold',
'streamline-micro-line',
'streamline-mini-bold',
'streamline-mini-line',
'streamline-regular',
'streamline-covid',
// TODO: move these to emojis when they are implemented
'freebies-freemojis',
'freebies-elections-old',
'freebies-stickers',
]
const illustrationFamiliesBeforeUrlChange = [
'illustrations-duotone',
'illustrations-brooklyn',
'illustrations-line',
'illustrations-multicolor',
]
// Next js Bundle Analyzer https://www.npmjs.com/package/@next/bundle-analyzer
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: true,
})
/**
* @type {import('next').NextConfig}
*/
let nextConfig = {
// We should not increase it, otherwise we run out of Vercel's limits.
staticPageGenerationTimeout: 60,
swcMinify: true,
reactStrictMode: true,
distDir: 'dist',
images: {
/**
* We are deactivating image optimization as they are charging for that
*/
unoptimized: true,
remotePatterns: [
{
protocol: 'https',
hostname: 'res.cloudinary.com',
},
{
protocol: 'https',
hostname: 'assets.streamlinehq.com',
},
],
},
/*
Optional build-time configuration options
https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#extend-nextjs-configuration
*/
sentry: {
// This will be true by default on Sentry 8.0 so meanwhile we need to force its usage
hideSourceMaps: true,
},
webpack: (config) => {
// Adds rule in order to be able to use svgs using import, otherwise we get an error
config.module.rules.push({
test: /\.svg$/i,
issuer: /\.[jt]sx?$/,
resourceQuery: {not: [/url/]}, // exclude react component if *.svg?url
use: ['@svgr/webpack'],
})
/*
* Start of CSS modules classes output format configuration
* This entire section is needed just to change CSS modules
* classes output format as seen here:
* https://stackoverflow.com/a/71450423/10504792
*/
config.resolve.modules.push(path.resolve('./'))
const oneOf = config.module.rules.find(
(rule) => typeof rule.oneOf === 'object'
)
if (oneOf) {
// Find the module which targets *.scss|*.sass files
const moduleSassRule = oneOf.oneOf.find((rule) =>
regexEqual(rule.test, /\.module\.(scss|sass)$/)
)
if (moduleSassRule) {
// Get the config object for css-loader plugin
const cssLoader = moduleSassRule.use.find(({loader}) =>
loader.includes('css-loader')
)
if (cssLoader)
cssLoader.options = {
...cssLoader.options,
modules: {
...cssLoader.options.modules,
localIdentName: '[local]--[hash:base64:5]',
// You can also add other css-loader options here
},
}
}
}
return config
},
}
/**
* rewrites, redirects, and headers are not supported on desktop
* See more info here: https://nextjs.org/docs/messages/export-no-custom-routes
**/
if (!isOnDesktop) {
nextConfig = {
...nextConfig,
/*
* Next export does not support i18n for desktop
*/
i18n: {
locales: ['en'],
defaultLocale: 'en',
},
// Redirect needed for redirecting from / for /icons page as /icons is the homepage for the app
async redirects() {
const redirects = []
{
iconFamiliesBeforeUrlChange.forEach((iconFamily) =>
redirects.push({
source: `/${iconFamily}`,
destination: `/icons/${iconFamily}`,
permanent: true,
})
)
}
{
illustrationFamiliesBeforeUrlChange.forEach((iconFamily) =>
redirects.push({
source: `/${iconFamily}`,
destination: `/illustrations/${iconFamily}`,
permanent: true,
})
)
}
return [
...redirects,
{
source: '/home',
destination: '/icons',
permanent: false,
},
{
source: '/profile/licenses',
destination: '/profile/user',
permanent: true,
},
{
source: '/profile/plan-and-billing',
destination: '/profile/user',
permanent: true,
},
{
source: '/checkout/brooklyn',
destination: 'https://www.streamlinehq.com/pricing',
permanent: true,
basePath: false,
},
{
source: '/upgrade',
destination: 'https://www.streamlinehq.com/pricing',
permanent: true,
basePath: false,
},
{
source: '/icons/freebies-freemojis',
destination: '/emojis/freebies-freemojis',
permanent: true,
},
{
source: '/request-password',
destination: '/icons?auth=request-password',
permanent: true,
},
{
source: '/login',
destination: '/signin',
permanent: true,
},
{
source: '/signin',
destination: '/icons?auth=sign-in',
permanent: true,
},
{
source: '/signup',
destination: '/icons?auth=sign-up',
permanent: true,
},
{
source: '/signup/confirm/',
destination: '/icons',
permanent: true,
},
{
source: '/reset-password',
destination: '/icons?auth=reset-password',
permanent: true,
},
{
source: '/create-password',
destination: '/icons?auth=reset-password',
permanent: true,
},
{
source: '/tools',
destination: 'https://www.streamlinehq.com/plugins/figma',
basePath: false,
permanent: true,
},
{
source: '/streamline-covid/virus-research',
destination: '/icons/covid/virus-research',
permanent: true,
},
{
source: '/illustrations-line/customer-support',
destination: '/illustrations/illustrations-line/customer-support',
permanent: true,
},
{
source: '/checkout',
destination: '/checkout/fullaccess',
permanent: true,
},
{
source: '/profile/subscriptions', // Old subscriptions page, this is now handled by Stripe Customer Portal
destination: '/profile/user',
permanent: false,
},
{
source: '/icons/streamline-covid',
destination: '/icons/covid',
permanent: true,
},
{
source: '/freebies-elections',
destination: '/icons',
permanent: true,
},
{
source: '/profile/developer',
destination: '/profile/user',
permanent: true,
},
{
source: '/freebies-stickers',
destination: '/emojis',
permanent: true,
},
{
source: '/attribution',
destination:
'https://help.streamlinehq.com/en/articles/5354403-how-to-create-an-attribution-link',
permanent: true,
basePath: false,
},
{
source: '/download-mac',
destination:
'https://github.com/webalys-hq/streamline-releases/releases/latest/download/Streamline.dmg',
permanent: true,
basePath: false,
},
{
source: '/plugins/powerpoint',
destination: '/',
permanent: true,
},
{
source: '/plugins/sketch',
destination: '/',
permanent: true,
},
{
source: '/plugins/adobe-xd',
destination: '/',
permanent: true,
},
{
source: '/free',
destination: '/freebies',
permanent: true,
},
{
source: '/dsp',
destination: '/icons',
permanent: true,
},
{
source: '/illustrations/brooklyn',
destination: '/illustrations/illustrations-brooklyn',
permanent: true,
},
{
source: '/icons/freebies-stickers',
destination: '/freebies',
permanent: true,
},
{
source: '/icons/streamline-flat-pro',
destination: '/icons/plump-flat',
permanent: true,
},
{
source: '/illustrations/web3.0-monoline',
destination: '/illustrations/web3.0-illustrations',
permanent: true,
},
{
source: '/illustrations/miami-monoline',
destination: '/illustrations/miami',
permanent: true,
},
{
source: '/icons/streamline-flex---free',
destination: '/icons/flex-free',
permanent: true,
},
{
source: '/icons/streamline-flat-free',
destination: '/icons/plump-free',
permanent: true,
},
{
source: '/elements/ink-bleed-minimalist',
destination: '/elements/ink-bleed-shapes',
permanent: true,
},
{
source: '/elements/adjustable-strokes-arrows',
destination: '/elements/sketch-annotations',
permanent: true,
},
{
source: '/elements/adjustable-strokes-annotations',
destination: '/elements/sketch-annotations',
permanent: true,
},
{
source: '/elements/adjustable-strokes-bubbles',
destination: '/elements/sketch-annotations',
permanent: true,
},
{
source: '/elements/adjustable-strokes-highlight',
destination: '/elements/sketch-annotations',
permanent: true,
},
{
source: '/elements/adjustable-strokes-icons',
destination: '/elements/sketch-annotations',
permanent: true,
},
{
source: '/elements/adjustable-strokes-illustrations',
destination: '/elements/sketch-annotations',
permanent: true,
},
{
source: '/elements/fixed-strokes-arrows',
destination: '/elements/sketch-elements-brushes',
permanent: true,
},
{
source: '/elements/fixed-strokes-annotations',
destination: '/elements/sketch-elements-brushes',
permanent: true,
},
{
source: '/elements/fixed-strokes-bubbles',
destination: '/elements/sketch-elements-brushes',
permanent: true,
},
{
source: '/elements/fixed-strokes-flag-ribbons',
destination: '/elements/sketch-elements-brushes',
permanent: true,
},
{
source: '/elements/fixed-strokes-highlight',
destination: '/elements/sketch-elements-brushes',
permanent: true,
},
{
source: '/elements/fixed-strokes-icons',
destination: '/elements/sketch-elements-brushes',
permanent: true,
},
{
source: '/elements/fixed-strokes-illustrations',
destination: '/elements/sketch-elements-brushes',
permanent: true,
},
{
source: '/elements/dimension-shade',
destination: '/elements/dimension',
permanent: true,
},
{
source: '/elements/dimension-line-shade',
destination: '/elements/dimension',
permanent: true,
},
{
source: '/elements/dimension-wireframe',
destination: '/elements/dimension',
permanent: true,
},
{
source: '/elements/dimension-line',
destination: '/elements/dimension',
permanent: true,
},
{
source: '/elements/dimension-patterns',
destination: '/elements/dimension',
permanent: true,
},
{
source: '/elements/stickers-flat',
destination: '/elements/stickers',
permanent: true,
},
{
source: '/elements/stickers-solid',
destination: '/elements/stickers',
permanent: true,
},
{
source: '/elements/sticky-notes-flat',
destination: '/elements/sticky-notes',
permanent: true,
},
{
source: '/elements/sticky-notes-solid',
destination: '/elements/sticky-notes',
permanent: true,
},
{
source: '/elements/washi-tapes-flat',
destination: '/elements/washi-tapes',
permanent: true,
},
{
source: '/elements/washi-tapes-solid',
destination: '/elements/washi-tapes',
permanent: true,
},
{
source: '/elements/geometric-badges-flat',
destination: '/elements/geometric-badges',
permanent: true,
},
{
source: '/elements/geometric-badges-solid',
destination: '/elements/geometric-badges',
permanent: true,
},
{
source: '/elements/classic-badges-line',
destination: '/elements/classic-badges',
permanent: true,
},
{
source: '/elements/classic-badges-combo',
destination: '/elements/classic-badges',
permanent: true,
},
{
source: '/elements/classic-badges-shadow',
destination: '/elements/classic-badges',
permanent: true,
},
{
source: '/elements/baskerville-ornaments',
destination: '/elements/typographic-ornaments',
permanent: true,
},
{
source: '/students',
destination: '/icons?auth=sign-up&auth-variant=education',
permanent: true,
},
{
source: '/icons/material-line',
destination: '/icons/nova-line',
permanent: true,
},
{
source: '/icons/material-solid',
destination: '/icons/nova-solid',
permanent: true,
},
{
source: '/elements/geometric-badges',
destination: '/elements/vector-badges',
permanent: true,
},
{
source: '/elements/classic-badges',
destination: '/elements/vector-badges',
permanent: true,
},
{
source: '/icons/ui-line-pro',
destination: '/icons/core-line',
permanent: true,
},
{
source: '/icons/streamline-mini-bold',
destination: '/icons/core-solid',
permanent: true,
},
{
source: '/icons/core-flat-pro',
destination: '/icons/core-flat',
permanent: true,
},
{
source: '/icons/core-duo',
destination: '/icons/core-duo-color',
permanent: true,
},
{
source: '/icons/flex-line-pro',
destination: '/icons/flex-line',
permanent: true,
},
{
source: '/icons/flex-solid',
destination: '/icons/flex-solid-style',
permanent: true,
},
{
source: '/icons/pastel-icons',
destination: '/icons/flex-duo',
permanent: true,
},
{
source: '/icons/flex-flat',
destination: '/icons/flex-flat-style',
permanent: true,
},
{
source: '/icons/sharp-line',
destination: '/icons/sharp-line-style',
permanent: true,
},
{
source: '/icons/sharp-solid',
destination: '/icons/sharp-solid-style',
permanent: true,
},
{
source: '/icons/sharp-duo',
destination: '/icons/sharp-duo-style',
permanent: true,
},
{
source: '/icons/sharp-flat',
destination: '/icons/sharp-flat-style',
permanent: true,
},
{
source: '/icons/plump-line-pro',
destination: '/icons/plump-line-style',
permanent: true,
},
{
source: '/icons/plump-solid-pro',
destination: '/icons/plump-solid-style',
permanent: true,
},
{
source: '/icons/plump-duo',
destination: '/icons/plump-duo-style',
permanent: true,
},
{
source: '/icons/plump-flat',
destination: '/icons/plump-flat-style',
permanent: true,
},
{
source: '/icons/streamline-micro-line',
destination: '/icons/micro-line',
permanent: true,
},
{
source: '/icons/streamline-micro-bold',
destination: '/icons/micro-solid',
permanent: true,
},
{
source: '/icons/core-free',
destination: '/icons/streamline-mini-line',
permanent: true,
},
{
source: '/newsletter',
destination: '/',
permanent: true,
},
{
source: '/features',
destination: '/',
permanent: true,
},
// We made a mistake in the past where we used a space(%20) instead of a dash in the URL for tags pages,
// this fixes it in case users try to access the wrong url again
{
source: '/:type/tag/:seg1%20:seg2',
destination: '/:type/tag/:seg1-:seg2',
permanent: true,
},
]
},
async rewrites() {
return [
{
source: '/',
destination: 'https://streamlinefree.framer.website/',
},
{
source: '/vector-illustrations',
destination:
'https://streamlinefree.framer.website/vector-illustrations',
},
{
source: '/vector-emojis',
destination: 'https://streamlinefree.framer.website/vector-emojis',
},
{
source: '/vector-elements',
destination: 'https://streamlinefree.framer.website/vector-elements',
},
{
source: '/vector-freebies',
destination: 'https://streamlinefree.framer.website/vector-freebies',
},
{
source: '/set/guidance',
destination: 'https://framer.streamlinehq.com/set/guidance',
},
{
source: '/plugins/figma',
destination: 'https://streamlinefree.framer.website/figma',
},
{
source: '/wall-of-love',
destination: 'https://streamlinefree.framer.website/testimonials',
},
{
source: '/testimonials',
destination: 'https://streamlinefree.framer.website/testimonials',
},
{
source: '/use-case',
destination: 'https://framer.streamlinehq.com/projects/interface',
},
{
source: '/use-cases',
destination: 'https://framer.streamlinehq.com/projects/interface',
},
{
source: '/download',
destination: 'https://streamlinefree.framer.website/download',
},
{
source: '/license-free',
destination: 'https://streamlinefree.framer.website/license-free',
},
{
source: '/license-premium',
destination: 'https://streamlinefree.framer.website/license-premium',
},
{
source: '/contact',
destination: 'https://streamlinefree.framer.website/contact',
},
{
source: '/pricing',
destination: 'https://streamlinefree.framer.website/pricing',
},
{
source: '/__/auth/:path*',
destination: `https://${firebaseAuthDomain}/__/auth/:path*`,
},
{
source: '/super',
destination: 'https://framer.streamlinehq.com/super',
},
{
source: '/free/:path*',
destination: 'https://framer.streamlinehq.com/free/:path*',
},
{
source: '/lucidchart',
destination: 'https://framer.streamlinehq.com/lucidchart',
},
{
source: '/lucidspark',
destination: 'https://framer.streamlinehq.com/lucidspark',
},
]
},
async headers() {
const securityHeaders = [
{
key: 'X-Content-Type-Options',
value: 'nosniff',
},
{
key: 'X-Frame-Options',
value: 'sameorigin',
},
]
return [
{
source: '/(.*)',
headers: securityHeaders,
},
]
},
}
}
/**
* @type any
*/
const defaultExport = withSentryConfig(nextConfig)
module.exports = isAnalyzingBundle
? withBundleAnalyzer(defaultExport)
: withNx(defaultExport)
- If I remove
withSentryConfig(nextConfig)and use directly nextConfig, the project works without sentry.
Expected Result
Works normally with withSentryConfig(nextConfig) support.
Actual Result
❯ npm run start:web
> streamline-mono@5.0.2 start:web
> nx reset && nx run models:check-env-vars && nx run streamline-web:serve --with-deps
> NX Resetting the Nx workspace cache and stopping the Nx Daemon.
This might take a few minutes.
> NX Daemon Server - Stopped
> NX Successfully reset the Nx workspace.
> nx run models:check-env-vars
————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
> NX Successfully ran target check-env-vars for project models (1s)
> nx run streamline-web:serve:development --with-deps
> NX SentryWebpackPlugin.cliBinaryExists is not a function
Pass --verbose to see the stacktrace.
————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
> NX Running target serve for project streamline-web failed
Failed tasks:
- streamline-web:serve:development
Hint: run the command with --verbose for more details.
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 16 (7 by maintainers)
@rdsedmundo Yes. Upgrading it would be a breaking change.
I ran into the same issue - using yarn workspaces with
@sentry/nextjsin one package and another@sentry/node+@sentry/webpack-pluginin another package. Is there any plan to resolve this such that the more recent version ofwebpack-plugincan be used?@lforst Thanks for look in to this.
it worked! thanks @lforst I will let you know if something comes up.
Btw the old version to use webpack plugin was
@lforst I fixed it downgrading @sentry/webpack-plugin from version 2.6.1 to 1.20 to match the version inside
@sentry/nextjsNow the project is working.Hi, can you check what versions of the
@sentry/clipackage you have installed in your node_modules after pruning your package manager cache and reinstalling them? Thanks!