Create-react-app: Using react-error-overlay as a standalone module

Created on 24 May 2017  路  9Comments  路  Source: facebook/create-react-app

react-error-overlay package looks amazing. Is there any documentation on how to use react-error-overlay independently? I am trying to use it in a project bootstrapped with react-boilerplate.

question

Most helpful comment

We don鈥檛 officially support using it directly quite yet. In other words there may be more breaking changes and little documentation for a while since we鈥檙e still iterating on it.

But if you鈥檙e feeling brave:

1) Import react-error-overlay in development config before application code. (example)

  1. Use its middleware in WebpackDevServer config.

Hope it helps!

All 9 comments

We don鈥檛 officially support using it directly quite yet. In other words there may be more breaking changes and little documentation for a while since we鈥檙e still iterating on it.

But if you鈥檙e feeling brave:

1) Import react-error-overlay in development config before application code. (example)

  1. Use its middleware in WebpackDevServer config.

Hope it helps!

I did exactly that before posting here. However, I am running to issues with the middleware. Thanks for the reply . I will check if there are changes to be done to my middleware to make it work with this.

hey @varunkumar the api turns out pretty simple especially if you are only looking to catch runtime errors. here is how you do just runtime errors: https://twitter.com/swyx/status/961413452446257152

and here is how I PR into react storybook https://github.com/storybooks/storybook/pull/2900

https://github.com/smooth-code/error-overlay-webpack-plugin is something you can either use directly in your Webpack setup or use as an example if you want to add it manually.

It'd be neat if:

  • the sourcemapping logic and the UI pieces got pulled out as separate packages
  • the colors were customizable as well

I just managed to put together a hacked-up version of the Redux DevTools Extension that uses getStackFrames() and <StackTrace> to show the callstack for a dispatched Redux action, but I had to copy-paste the entire react-error-overlay codebase into the DevTools project in order to use it.

The packages were separate at one point.
We flattened everything using Rollup when we brought it into Create React App.

Now that changes have stabilized, it may be worth separating everything again and pulling it out of this monorepo.

That'd be helpful, yeah.

If you're interested, here's the thread that discusses my changes, links to the PRs for the extension, and has some unofficial builds of the extension if you'd like to play around with them:

https://github.com/zalmoxisus/redux-devtools-extension/issues/429

Does this need a new issue since it is being considered again (as per @Timer ), or should this one re-open?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rdamian3 picture rdamian3  路  3Comments

wereHamster picture wereHamster  路  3Comments

AlexeyRyashencev picture AlexeyRyashencev  路  3Comments

Aranir picture Aranir  路  3Comments

stopachka picture stopachka  路  3Comments