# bc-webpack-error-reporting-plugin

> Logs webpack errors into any given API

Latest version **0.0.2** (published 2019-09-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install bc-webpack-error-reporting-plugin
pnpm add bc-webpack-error-reporting-plugin
yarn add bc-webpack-error-reporting-plugin
bun add bc-webpack-error-reporting-plugin
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2019-09-16 |
| First published | 2019-05-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.0.0 |
| Dependencies | 6 |
| Unpacked size | 13.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Alejandro Sanchez |
| Maintainers | alesanchezr |
| Keywords | friendly, errors, webpack, plugin |

## Links

- npm: https://www.npmjs.com/package/bc-webpack-error-reporting-plugin
- Repository: https://github.com/breatheco-de/webpack-reporting-plugin
- Homepage: https://github.com/breatheco-de/webpack-reporting-plugin#readme
- Issues: https://github.com/breatheco-de/webpack-reporting-plugin/issues
- npm.io page: https://npm.io/package/bc-webpack-error-reporting-plugin

## Dependencies (6)

- [chalk](https://npm.io/package/chalk.md) ^2.4.2
- [webpack](https://npm.io/package/webpack.md) ^4.30.0
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.5.0
- [strip-ansi](https://npm.io/package/strip-ansi.md) ^3
- [string-width](https://npm.io/package/string-width.md) ^2.0.0
- [error-stack-parser](https://npm.io/package/error-stack-parser.md) ^2.0.2

## Alternatives

- [@sentry/react-native](https://npm.io/package/@sentry/react-native.md) — 2.6M weekly downloads
- [@ardatan/aggregate-error](https://npm.io/package/@ardatan/aggregate-error.md) — 708.1K weekly downloads
- [custom-error-generator](https://npm.io/package/custom-error-generator.md) — 2.0K weekly downloads
- [@technik-sde/prosemirror-recreate-transform](https://npm.io/package/@technik-sde/prosemirror-recreate-transform.md) — 1.5K weekly downloads
- [@suchipi/error-utils](https://npm.io/package/@suchipi/error-utils.md) — 78 weekly downloads

## Recent versions

- 0.0.2 (latest) — 2019-09-16
- 0.0.1 — 2019-05-09

## README

# ![alt text](https://assets.breatheco.de/apis/img/images.php?blob&random&cat=icon&tags=breathecode,32) Webpack's Error Reporting Plugin

This webpack plugin will do a POST call to any given URL every time webpack find an error.

This plugin is fully compatible with:
- Babel.
- esLint.

## Installation

```
$ npm install bc-webpack-error-reporting-plugin --save-dev
```

## Sample Configuration

Add the following configuration into your webpack plugins

```js
//at the top of your webpack.condig.js
const WebpackErrorReporting = require("@breathecode/webpack-error-reporting-plugin");

//inside your webpack plugin configuration
  plugins: [

    new WebpackErrorReporting({
        hookURL: 'https://path/to/url/hook', //(mandatory) the plugin will POST the array of errors to this url
        username: 'alesanchezr', //(mandatory) any username to identify the developer (it will be passed on each error)
        token: 'Bearer sdSSDFwefEWFewrfewr43234FSD34r', //(optional) this will be the authorization header
        silent: true //(optional) log plugin activity on the console
    }),

  ]

```

## Sample Request with Errors Found

This is an example of the request body that can be sent to your HOOK backend API.

```json
[
	{
		"message":"Module not found ./component/homee.js",
		"file":"./src/js/index.js",
        "username": "bobdylan",
		"origin":"\n @ ./src/js/index.js 9:0-44 11:36-40\n @ multi ./src/js/index.js",
		"name":"Module not found",
		"severity":900,
		"type":"module-not-found",
		"module":"./component/homee.js",
		"slug":"webpack_error",
		"details":"ModuleNotFoundError: Module not found: Error: Can't resolve './component/homee.js' in '/workspace/webpack-reporting-plugin/_sandbox/src/js'"

	}
]
```

---
_Source: https://npm.io/package/bc-webpack-error-reporting-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
