Open erezmus opened 5 years ago
@hdrury1 FYI once you're back. We had HotJar feedback today that somebody couldn't submit, and they shared an error code Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.
Peter says it's not clear what the error is and there was an investigation into getting more useful errors from react. This ticket was raised as a result and I assume might only help us learn more about the error, so I guess we could still have users with this problem until we look into this.
Added an artificial error to generate the same problem in the frontend. Seems that when running in production mode, no errors are sent to newrelic.
After a lot of trial and error, it turns out that having an ErrorBoundary swallows the erros. They were still visible on development due to react behaviour in development mode as described in https://reactjs.org/docs/error-boundaries.html#component-stack-traces
React 16 prints all errors that occurred during rendering to the console in development, even if the application accidentally swallows them.
So it seems a simple fix is to send the error via the newrelic api
Can confirm that errors are now being logged in new relic in production mode.
Next bit is getting the source files uploaded
Still can't seem to be able to upload source maps. Added a ticket on support:
Follow up from #2237.
At the moment we are using the
app/assets/newrelic.js
. It might be that it needs updating or that we switch to using the node.js agent.To test it out locally, one would need to run as in production using
node app
and configure local reviewer to use newrelic keys (probably need a separate app for local testing on newrelic).