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

Cannot set property onunhandledrejection of [object Object] which has only a getter #63

Open
patelnav opened this issue Jan 4, 2019 · 6 comments

Comments

@patelnav
Copy link

patelnav commented Jan 4, 2019

This may have birthed from Issue#35.

I'm seeing logs with the following error:

TypeError: Cannot set property onunhandledrejection of [object Object] which has only a getter
    at onunhandledrejection (../node_modules/stackdriver-errors-js/stackdriver-errors.js:91:0)
    at window.addEventListener (index.js:133:15)

This is happening on my starting the ErrorReporter. index.js:133 is line 3:

window.addEventListener('DOMContentLoaded', function () {
  var errorHandler = new StackdriverErrorReporter();
  errorHandler.start({
    targetUrl: '<my_url>',
  });
})

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36

@steren
Copy link
Collaborator

steren commented Jan 4, 2019

Thanks for the report. Do you confirm you are using the module at HEAD?

@patelnav
Copy link
Author

patelnav commented Jan 4, 2019

I just installed from npm, so it's the 0.5.0 release.

Should I wait for a minor release or just start using HEAD?

@patelnav
Copy link
Author

patelnav commented Jan 5, 2019

I did a bit of digging. It seems I was rejecting a promise with a string, which caused this section to generate an error to report. So the stack starts at this point.

Unfortunately the stack traces cross async-boundaries on these Promises, so they not particularly useful.

Unless you guys can figure out how to get the full stacktrace, perhaps it would be more useful to not have a StackTrace rather than a partial & internal one.

@steren
Copy link
Collaborator

steren commented Jan 22, 2019

Version 0.5.0 is supposed to work.

Would you be able to provide a minimal sample (e.g. on codepen) that reproduces the issue?

@patelnav
Copy link
Author

hmmm. was trying this, ran into another issue.
The CDN ( https://cdn.jsdelivr.net/npm/stackdriver-errors-js@0.5.0/dist/ ) doesn't even have a window.onunhandledrejection

A messup on publishing to CDN?

@patelnav
Copy link
Author

Can't seem to repro this right now ( https://codepen.io/navpatel/pen/LqYZKq ).
Will try to dig up how this happened on my end and figure it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants