Registry / http-networking / webpack-bugsnag-plugins

webpack-bugsnag-plugins

JSON →
library2.2.3jsnpmunverified

Webpack plugins for reporting builds and uploading source maps to Bugsnag error monitoring. Current stable version is 2.2.3, released 2024 with maintenance updates. These plugins integrate Bugsnag's CLI for source map upload and build reporting directly into the Webpack build pipeline. Key differentiator: seamless integration with webpack 3/4/5, automatic source control detection from .git/.hg/package.json, and configurable log levels. Replaces manual invocation of @bugsnag/cli. Suitable for production builds to ensure stack traces are deobfuscated and build metadata is captured.

npm install webpack-bugsnag-plugins
INSTALL
IMPORT
SIG · WEBPACK-BUGSNAG-PL
W
webpack-bugsnag-plugins
http-networkingjavascriptv2.2.3
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

BugsnagBuildReporterPlugin
import { BugsnagBuildReporterPlugin } from 'webpack-bugsnag-plugins'
import BugsnagBuildReporterPlugin from 'webpack-bugsnag-plugins'
Named export, not default. ESM/CJS compatible.
BugsnagSourceMapUploaderPlugin
const { BugsnagSourceMapUploaderPlugin } = require('webpack-bugsnag-plugins')
let BugsnagSourceMapUploaderPlugin = require('webpack-bugsnag-plugins')
CommonJS require with destructuring. Do not assign the whole module.
WebpackPlugin
new BugsnagBuildReporterPlugin({ apiKey: 'YOUR_KEY', appVersion: '1.0.0' })
new BugsnagBuildReporterPlugin('YOUR_KEY', '1.0.0')
First argument must be an object, not separate strings. Since v2.

Minimal webpack config using both plugins for production builds. Filters out plugins when not in dist mode.

// webpack.config.js const { BugsnagBuildReporterPlugin, BugsnagSourceMapUploaderPlugin } = require('webpack-bugsnag-plugins'); const isDistEnv = process.env.NODE_ENV === 'production'; module.exports = { entry: './app.js', output: { path: __dirname, filename: 'bundle.js' }, plugins: [ isDistEnv && new BugsnagBuildReporterPlugin({ apiKey: process.env.BUGSNAG_API_KEY, appVersion: require('./package.json').version, releaseStage: 'production' }), isDistEnv && new BugsnagSourceMapUploaderPlugin({ apiKey: process.env.BUGSNAG_API_KEY, appVersion: require('./package.json').version, publicPath: 'https://example.com/js', overwrite: true }) ].filter(Boolean) };
bugsnag-cli --version
Debug
Known issues
breakingv2.0.0 migrated from @bugsnag/source-maps and @bugsnag/build-reporter to @bugsnag/cli. Existing users of pre-2.0 must update configuration and install @bugsnag/cli as a peer dependency.
fix
Upgrade to v2+ and ensure @bugsnag/cli is in devDependencies. See CHANGELOG.
affects: <2.0.0
gotchaThe 'overwrite' option for source map upload was added in v2.1.0. In v2.0.0, it is not available.
fix
Upgrade to v2.1.0 or later to use overwrite option.
affects: 2.0.0
gotchaThe build reporter will not send a report if compilation fails before the 'after-emit' hook. This can lead to missing builds in Bugsnag dashboard.
fix
Check webpack compilation result; ensure plugin runs only after successful builds.
affects: >=1.0.0
deprecatedUsing separate 'apiKey' and 'appVersion' as two function arguments was deprecated in v1.x and removed in v2. Use a single options object.
fix
Pass an object: new BugsnagBuildReporterPlugin({ apiKey: ..., appVersion: ... })
affects: >=2.0.0
gotchaIf you don't set 'releaseStage' in build reporter, the build will not auto-assign unless you set 'autoAssignRelease: true'.
fix
Explicitly set releaseStage or autoAssignRelease to true.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module '@bugsnag/cli'
Missing peer dependency @bugsnag/cli (required since v2.0.0).
fix
npm install --save-dev @bugsnag/cli
TypeError: BugsnagBuildReporterPlugin is not a constructor
Using default import instead of named import.
fix
Use const { BugsnagBuildReporterPlugin } = require('webpack-bugsnag-plugins'); or import { BugsnagBuildReporterPlugin } from 'webpack-bugsnag-plugins';
Error: Plugin could not be instantiated: invalid options
Passed apiKey and appVersion as separate arguments instead of an object.
fix
new BugsnagBuildReporterPlugin({ apiKey: '...', appVersion: '...' })
Upgrade
Version history
2.2.3latest on npm
Audit
Dependencies
webpackrequiredpeer dependency required; plugins are Webpack plugins and need the webpack compiler instance
Agent activity
38 hits · last 30 days
node
34
OpenAI (training)
1
Resources
webpack-bugsnag-plugins — npm install webpack-bugsnag-plugins · libregistry