move rollbar _createItem to top.. (remove error _createItem not defined)
In node 8.16 the lib is making an error _createItem is not defined. moved the function defintion to top to fix it.
@stuk88 Can you tell me more about the error? I'm not aware of this generating an error in node.
@stuk88 Can you tell me more about the error? I'm not aware of this generating an error in node.
_createItem is not defined

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)
PLEASE MERGE THIS HOLY SHIT
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 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.
I'm getting this error in my logs