Unlike other projects, we can't get access to source maps because the Webpack config can't be edited with CRA.
The Netlify-provided env vars that add context to Rollbar errors needed to be renamed from VAR_NAME to REACT_APP_VAR_NAME in the build script to make them available to the app.
Connects #29
Demo
Testing Instructions
Visit the Netlify deploy preview for this PR.
Inspect the Netlify script tag in the HEAD element, find the config block at the top, and verify all of the config variables are populated.
Trigger an error in the console: window.onerror("TestError: Hello world", window.location.href)
Visit the Rollbar page for the project, and verify the error was logged.
Overview
Add client-side error reporting via Rollbar.
Unlike other projects, we can't get access to source maps because the Webpack config can't be edited with CRA.
The Netlify-provided env vars that add context to Rollbar errors needed to be renamed from
VAR_NAME
toREACT_APP_VAR_NAME
in the build script to make them available to the app.Connects #29
Demo
Testing Instructions
HEAD
element, find the config block at the top, and verify all of the config variables are populated.window.onerror("TestError: Hello world", window.location.href)