-
Notifications
You must be signed in to change notification settings - Fork 751
Description
When using the prerender option, react-rails will rescue any JavaScript errors. This will log it and continue, which will just render the react ujs tag, and when the browser tries to render the component it will most likely encounter the same error and throw to the browser console for a better debugging experience.
While this may be the case for some JS errors, it is not the case for errors that happen when running JS not in the browser context but that don't happen when running JS in the browser context. For example, the window
object is available in the browser context but not available in the non-browser context, causing errors like "window is not defined". By rescuing these exceptions, seeing that something is broken in these situations is difficult.
What do you think about not rescuing JS exceptions when prerendering? This would make debugging in these situations quite a bit less mysterious. Folks who want a better debugging environment for JS errors that happen on the client side should be able to easily disable prerender.