rollbar.js icon indicating copy to clipboard operation
rollbar.js copied to clipboard

move rollbar _createItem to top.. (remove error _createItem not defined)

Open stuk88 opened this issue 4 years ago • 7 comments

In node 8.16 the lib is making an error _createItem is not defined. moved the function defintion to top to fix it.

stuk88 avatar Oct 17 '19 19:10 stuk88

@stuk88 Can you tell me more about the error? I'm not aware of this generating an error in node.

waltjones avatar Oct 17 '19 21:10 waltjones

@stuk88 Can you tell me more about the error? I'm not aware of this generating an error in node.

_createItem is not defined

image

stuk88 avatar Dec 08 '19 20:12 stuk88

My guess this is an error during initialization. A complete stack trace rather than just the image of the offending frame would probably be more helpful if anyone else sees this (I don't use JS on the server and therefore haven't run into this)

terencehonles avatar Feb 25 '21 00:02 terencehonles

PLEASE MERGE THIS HOLY SHIT

lopugit avatar Jul 22 '21 13:07 lopugit

I believe the actual root cause for this issue is passing rollbar.error in as a callbak function.

Say with a new Promise((res,rej)=>{rej()}).catch(rollbar.error)

the this context is broken

lopugit avatar Jul 22 '21 13:07 lopugit

@lopugit Thanks for that observation. I'll try it and see what I get.

As for this PR, there are some reasons not to merge as is. The style throughout the project favors putting helper functions at the end of the file whether on the prototype or not. I don't have insight yet about why only _createItem would be causing a problem. Also, I don't approve/merge things without a known repro case, and until now I haven't had insight about how or why this issue happens. I've never (yet) seen it myself.

waltjones avatar Jul 22 '21 13:07 waltjones

I'm getting this error in my logs

Screen Shot 2021-09-30 at 11 42 18 PM

javorosas avatar Sep 30 '21 21:09 javorosas