Registry / devops / esbuild-bugsnag-plugins

esbuild-bugsnag-plugins

JSON →
library1.0.8jsnpmunverified

esbuild-bugsnag-plugins provides esbuild plugins to integrate Bugsnag error monitoring, focusing on automatic source map uploads during esbuild bundling. Current stable version is v1.0.8, released in early 2024. It is a lightweight, purpose-specific alternative to general-purpose source map uploaders like @bugsnag/source-maps, designed to work seamlessly with esbuild's plugin system. The package ships TypeScript definitions and has peer dependency on TypeScript ^5.7.3.

npm install esbuild-bugsnag-plugins
INSTALL
IMPORT
SIG · ESBUILD-BUGSNAG-PL
E
esbuild-bugsnag-plugins
devopsjavascriptv1.0.8
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

bugsnagPlugin
import { bugsnagPlugin } from 'esbuild-bugsnag-plugins'
const bugsnagPlugin = require('esbuild-bugsnag-plugins')
Package is ESM-only since v1.0.0. Use dynamic import for CommonJS: const { bugsnagPlugin } = await import('esbuild-bugsnag-plugins')
bugsnagPlugin (TypeScript)
import type { BugsnagPluginOptions } from 'esbuild-bugsnag-plugins'
import { BugsnagPluginOptions } from 'esbuild-bugsnag-plugins'
Use 'import type' to avoid runtime bundling of types
Default export
import bugsnagPlugin from 'esbuild-bugsnag-plugins'
import { default as bugsnagPlugin } from 'esbuild-bugsnag-plugins'
Default export is the same as named export bugsnagPlugin; either works since v1.0.0

Shows how to use the bugsnagPlugin to upload source maps during esbuild build, with required options.

import { bugsnagPlugin } from 'esbuild-bugsnag-plugins'; import * as esbuild from 'esbuild'; await esbuild.build({ entryPoints: ['app.ts'], outfile: 'out.js', bundle: true, sourcemap: true, plugins: [bugsnagPlugin({apiKey: process.env.BUGSNAG_API_KEY ?? '', appVersion: '1.0.0', releaseStage: 'production'})], });
Debug
Known issues
breakingPackage is ESM-only since v1.0.0; CommonJS require() will not work
fix
Use dynamic import: const { bugsnagPlugin } = await import('esbuild-bugsnag-plugins')
affects: >=1.0.0
deprecatedOptions format change in v1.0.5: 'appVersion' now required, 'releaseStage' defaults to 'production'
fix
Update plugin options: ensure appVersion and releaseStage are passed
affects: <1.0.5
gotchaExported symbol case: function is named 'bugsnagPlugin' (lowercase b), not 'BugsnagPlugin'
fix
Import with correct casing: import { bugsnagPlugin } from 'esbuild-bugsnag-plugins'
affects: >=1.0.0
deprecatedThe 'writeKey' option has been deprecated in favor of 'apiKey' since v1.0.3
fix
Replace 'writeKey' with 'apiKey' in plugin options
affects: >=1.0.0
gotchaSourcemap must be enabled in esbuild config; plugin does not automatically inject sourcemap
fix
Pass 'sourcemap: true' in esbuild build options
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: bugsnagPlugin is not a function
Importing as default import but package only exports named export 'bugsnagPlugin' with default export as same
fix
Use named import: import { bugsnagPlugin } from 'esbuild-bugsnag-plugins'
Error: Cannot find module 'esbuild-bugsnag-plugins'
Package is ESM-only and Node.js require() path resolution fails without .js extension
fix
Enable ESM in package.json ("type": "module") or use dynamic import: const mod = await import('esbuild-bugsnag-plugins')
Error: appVersion is required
Missing required option 'appVersion' since v1.0.5
fix
Provide appVersion in plugin options: { appVersion: '1.0.0' }
Upgrade
Version history
1.0.8latest on npm
Audit
Dependencies
typescriptoptionalPeer dependency for TypeScript type definitions and compilation support
Agent activity
2 hits · last 30 days
node
2
Resources
esbuild-bugsnag-plugins — npm install esbuild-bugsnag-plugins · libregistry