Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow rollbar instance from alternate import/require #37

Merged
merged 1 commit into from
Mar 1, 2022

Conversation

waltjones
Copy link
Contributor

Description of the change

The Provider validates the Rollbar instance, when one is in the props, by testing instanceof the default Rollbar import. This fails when the instance was constructed from another import or require. The specific issue report involves using the noconflict bundle.

This PR looks for an initialized options object instead. This will successfully catch common errors like passing the constructor function or failing to initialize before passing the instance.

Type of change

  • Bug fix (non-breaking change that fixes an issue)

Related issues

Fixes #24

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

Code review

  • This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
  • "Ready for review" label attached to the PR and reviewers assigned
  • Issue from task tracker has a link to this pull request
  • Changes have been reviewed by at least one other engineer

@waltjones waltjones merged commit 899988f into main Mar 1, 2022
ijsnow pushed a commit to ijsnow/rollbar-react that referenced this pull request Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invariant violation when attempting to use Rollbar inside embedded component
2 participants