Bugsnag-js: Question/help wanted: how to integrate BugSnag with Electron-Vue?

Created on 8 Jan 2019  路  8Comments  路  Source: bugsnag/bugsnag-js

I already asked this question over at https://github.com/SimulatedGREG/electron-vue/issues/769 without any response to this date, so maybe someone here can point me in to the right direction.

I'm trying to use Bugsnag with Electron-Vue but I always get the following error:

import bugsnag from '@bugsnag/js'
import bugsnagVue from '@bugsnag/plugin-vue'
const bugsnagClient = bugsnag('API_KEY')
bugsnagClient.use(bugsnagVue, Vue)
....\node_modules\@bugsnag\node\dist\bugsnag.js:2138 Uncaught TypeError: setInterval(...).unref is not a function
    at SessionTracker.start (....\node_modules\@bugsnag\node\dist\bugsnag.js:2138)
    at Object.init (....\node_modules\@bugsnag\node\dist\bugsnag.js:2028)
    at BugsnagClient.use (....\node_modules\@bugsnag\node\dist\bugsnag.js:163)
    at ....\node_modules\@bugsnag\node\dist\bugsnag.js:1578
    at Array.forEach (<anonymous>)
    at module.exports (....\node_modules\@bugsnag\node\dist\bugsnag.js:1577)
    at eval (main.js?3b76:3)
    at Object.<anonymous> (renderer.js:1636)
    at __webpack_require__ (renderer.js:680)
    at fn (renderer.js:90)

Should we even still be using the @bugsnag/plugin-vue as it's now deprecated?
https://docs.bugsnag.com/platforms/javascript/vue/

Thanks!

Most helpful comment

You could just provide an empty function to it:

setTimeout(function {}).__proto__.unref = function () {}

There isn't a bugsnag config file per say, but it sounds like that commenter has created one to hold their configuration.

All 8 comments

This issue is caused by the same thing as #452. You can probably use the ugly hack in there to get by until we are able to fix this properly!

Should we even still be using the @bugsnag/plugin-vue as it's now deprecated?

@bugsnag/plugin-vue is a new package and it's not deprecated. We deprecated this one.

_My apologies, I got those package names mixed up.._

Thanks for the super quick reply, but still no luck..

Uncaught TypeError: Failed to execute 'setTimeout' on 'Window': 1 argument required, but only 0 present. at eval (main.js?3b76:2) at Object.<anonymous> (renderer.js:1664) at __webpack_require__ (renderer.js:680) at fn (renderer.js:90) at Object.<anonymous> (renderer.js:1581) at __webpack_require__ (renderer.js:680) at renderer.js:726 at renderer.js:729

Where do you recommend putting that line of code? One of the comments reads:

P.S: Yes, adding the following hack to the bugsnag.js (config file) does help.

But I couldn't find anything about a bugsnag config file?

You could just provide an empty function to it:

setTimeout(function {}).__proto__.unref = function () {}

There isn't a bugsnag config file per say, but it sounds like that commenter has created one to hold their configuration.

Works! Thanks a million for your help!

You could just provide an empty function to it:

setTimeout(function {}).__proto__.unref = function () {}

There isn't a bugsnag config file per say, but it sounds like that commenter has created one to hold their configuration.

You could just provide an empty function to it:

setTimeout(function {}).__proto__.unref = function () {}

There isn't a bugsnag config file per say, but it sounds like that commenter has created one to hold their configuration.

Is this suppose to be:

setTimeout(function () {}).__proto__.unref = function () {}

Was getting a compile error without the ().

@joshuapinter Here's the line of code I used:

setTimeout(() => {}).__proto__.unref = function () {}

@celcius-jochen Thanks for confirming. 馃憤 Yeah, there was missing brackets in @bengourley's code snippet.

Btw, instead of mixing old school and new school, you should also be able to do:

setTimeout(() => {}).__proto__.unref = () => {}

Sorry about that 馃槃 I wrote it like () => {} and thought I ought to convert to function () {} in case people weren't familiar with arrow functions and messed it up!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

killia15 picture killia15  路  6Comments

antoinerousseau picture antoinerousseau  路  4Comments

vikrantnegi picture vikrantnegi  路  5Comments

Andarius picture Andarius  路  3Comments

livthomas picture livthomas  路  4Comments