getsentry / sentry-javascript-bundler-plugins

JavaScript Bundler Plugins for Sentry
https://sentry.io
BSD 3-Clause "New" or "Revised" License
142 stars 37 forks source link

TypeError: Plugin is not a constructor #629

Open vaynevayne opened 1 week ago

vaynevayne commented 1 week ago

Image

const { sentryWebpackPlugin } = require('@sentry/webpack-plugin')

      webpackChain(chain) {
        chain.resolve.plugin('tsconfig-paths').use(TsconfigPathsPlugin)
        chain.devtool('source-map')

        if (process.env.NODE_ENV === 'production') {
          chain.plugin('sentry').use(sentryWebpackPlugin, [
            {
              authToken: process.env.SENTRY_AUTH_TOKEN,
              org: 'sentry',
              project: 'xxxxx',
              url: 'https://sentry.intsig.net/',
              sourcemaps: {
                filesToDeleteAfterUpload: ['dist/h5/**/*.{js,css}.map'],
              },
              urlPrefix: '~/dist',
              setCommits: {
                auto: true,
              },
            },
          ])
        }
      },
andreiborza commented 1 week ago

Hi @vaynevayne, thanks for filing this.

Could you please provide a reproduction repo so we can look into this?