All Projects → commissure → Redbox React

commissure / Redbox React

Licence: mit
🔴 A redbox (rsod) component to display your JavaScript errors.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Redbox React

Make Error Cause
Make your own nested errors
Stars: ✭ 36 (-94.81%)
Mutual labels:  stack-traces
Trace
Creates super long stack traces
Stars: ✭ 183 (-73.63%)
Mutual labels:  stack-traces
nested-error-stacks
A node.js module for creating Error objects with nested Errors in stacktraces
Stars: ✭ 86 (-87.61%)
Mutual labels:  stack-traces
Rollbar Android
Rollbar for Android
Stars: ✭ 41 (-94.09%)
Mutual labels:  stack-traces
Ben.demystifier
High performance understanding for stack traces (Make error logs more productive)
Stars: ✭ 2,142 (+208.65%)
Mutual labels:  stack-traces
Panicparse
Crash your app in style (Golang)
Stars: ✭ 2,954 (+325.65%)
Mutual labels:  stack-traces
Lofty
Coroutines, stack traces and smart I/O for C++11, inspired by Python and Golang.
Stars: ✭ 5 (-99.28%)
Mutual labels:  stack-traces
Log
📗 Simple, configurable and scalable Structured Logging for Go.
Stars: ✭ 276 (-60.23%)
Mutual labels:  stack-traces
Loglevel
📒 Minimal lightweight logging for JavaScript, adding reliable log level methods to wrap any available console.log methods
Stars: ✭ 2,133 (+207.35%)
Mutual labels:  stack-traces
stack-trace-art
Turning programming exceptions into art
Stars: ✭ 39 (-94.38%)
Mutual labels:  stack-traces
Scala Trace Debug
Macro based print debugging. Locates log statements in your IDE.
Stars: ✭ 110 (-84.15%)
Mutual labels:  stack-traces
Ololog
A better console.log for the log-driven debugging junkies
Stars: ✭ 141 (-79.68%)
Mutual labels:  stack-traces
Stacktrace
C++ library for storing and printing backtraces.
Stars: ✭ 250 (-63.98%)
Mutual labels:  stack-traces
Fliplog
fluent logging with verbose insight, colors, tables, emoji, filtering, spinners, progress bars, timestamps, capturing, stack traces, tracking, presets, & more...
Stars: ✭ 41 (-94.09%)
Mutual labels:  stack-traces
heob
Detects buffer overruns and memory leaks.
Stars: ✭ 103 (-85.16%)
Mutual labels:  stack-traces
Stacked
Stack traces for Swift on Mac and Linux 📚
Stars: ✭ 24 (-96.54%)
Mutual labels:  stack-traces
Asyncfriendlystacktrace
Async-friendly format for stack traces and exceptions
Stars: ✭ 205 (-70.46%)
Mutual labels:  stack-traces
Rxjava2debug
RxJava 2.x extension to provide meaningful Stack Traces
Stars: ✭ 673 (-3.03%)
Mutual labels:  stack-traces
happybot
A multi-purpose, feature-full, and powerful, highly guild-specific, Discord Bot written in Java.
Stars: ✭ 14 (-97.98%)
Mutual labels:  stack-traces
ghc-stack
Hacking GHC's Stack for Fun and Profit (featuring The Glorious Haskell Debugger v0.0.1 Pre-alpha)
Stars: ✭ 69 (-90.06%)
Mutual labels:  stack-traces

redbox-react

Build Status semantic-release

The red box (aka red screen of death) renders an error in this “pretty” format:

red screen of death

Usage

Catch an error and give it to redbox-react. Works great with

or manually:

import RedBox from 'redbox-react'

const e = new Error('boom')
const box = <RedBox error={e} />

Here is a more useful, full-fleged example:

/* global __DEV__ */
import React from 'react'
import { render } from 'react-dom'
import App from './components/App'

const root = document.getElementById('root')

if (__DEV__) {
  const RedBox = require('redbox-react').default
  try {
    render(<App />, root)
  } catch (e) {
    render(<RedBox error={e} />, root)
  }
} else {
  render(<App />, root)
}

What Is This Good For?

An error that's only in the console is only half the fun. Now you can use all the wasted space where your app would be if it didn’t crash to display the error that made it crash.

Please use this in development only.

Will this catch errors for me?

No. This is only a UI component for rendering errors and their stack traces. It is intended to be used with with other existing solutions that automate the error catching for you. See the list at the top of this document or take a look at the examples.

Optional Props

The RedBox component takes a couple of props that you can use to customize its behaviour:

editorScheme [?string]

If a filename in the stack trace is local, the component can create the link to open your editor using this scheme eg:

  • subl to create subl://open?url=file:///filename.
  • or vscode to create vscode://file/filename.

useLines [boolean=true]

Line numbers in the stack trace may be unreliable depending on the type of sourcemaps. You can choose to not display them with this flag.

useColumns [boolean=true]

Column numbers in the stack trace may be unreliable depending on the type of sourcemaps. You can choose to not display them with this flag.

style [?object]

Allows you to override the styles used when rendering the various parts of the component. It will be shallow-merged with the default styles.

If you’re using react-transform-catch-errors you can add these options to your .babelrc through the imports property.

Sourcemaps With Webpack

If you’re using Webpack you can get accurate filenames in the stacktrace by setting the output.devtoolModuleFilenameTemplate settings to /[absolute-resource-path].

It's recommended to set the devtool setting to 'eval'.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].