Closed mikecann closed 2 years ago
After more node_modules/raygun4js/dist/raygun.umd.js
spelunking I managed to track it down and get it working.
It appears that there is an order of operations issue happening where onLoadHandler
is looking for apiKey
to be set but it hasnt by that point so rg.init
never gets called.
I fixed this by manually initting:
const instance = rg4js("getRaygunInstance") as any;
if (instance)
instance.init(
config.BT_RAYGUN_API_KEY,
{
ignore3rdPartyErrors: false,
debugMode: true,
},
null
);
hacky but works.
Hi im trying to setup raygun in my chrome extension.
It works from a website fine but for some reason not in the extension.
Im using the npm version of raygun4js.
At first I thought it was somehow filtering it out thanks to this line: https://github.com/MindscapeHQ/raygun4js/blob/3c07dc178ca34adaacae7fbd9efe6550e21da18b/src/raygun.js#L1140
But when I added some debug console lines around it I found out that its not event getting to that part and is instead exiting the function here: https://github.com/MindscapeHQ/raygun4js/blob/dd4bf9808ccf570ddc271f2239596159bb61344b/src/raygun.js#L706
It appears that the
_providerState !== ProviderStates.READY
.. any idea why this might be? Im not getting any errors from raygun despite having setdebugMode: true
perhaps this is because I setdebugMode: true
AFTER the init error?!