You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cannot read properties of undefined (reading 'context') #102
I'm trying to use RollbarContext and it's giving me an error on its componentDidMount function as it's trying to access rollbar.options.payload.context (see here). Looking at the rollbar.options object, there's no payload.
Activity
jerimiahmilton commentedon Jul 11, 2024
Running into the same issue, here's my usage:
mxwoz1234 commentedon Oct 17, 2024
I have a similar issue.
`
const rollbarConfig = {
accessToken: 'xxxxx',
environment: 'production',
};
export default function App() {
return (
}
`
DToppingWW commentedon Feb 18, 2025
I came across this same issue as well, using:
@rollbar/react: 0.11.2,rollbar: 2.26.4I think the Rollbar library should be able to set a default payload if none is provided in the initial config.
Workaround:
Setup the Provider to have a default value in the config for
payload.as long as the payload object is defined initially, then setting a context later will not throw an error.
Fix RollbarContext without a payload (#102), make onRender work and d…