a.loadFull is not a function
Closed this issue · 10 comments
Hello.
I am wondering what could be causing this error:
Error: [$injector:modulerr] Failed to instantiate module my_module_name due to:
TypeError: a.loadFull is not a function
at Object.<anonymous> (bower_components/ng-rollbar/ng-rollbar.js:32:444)
It only appears when I'm running unit tests. Otherwise, rollbarProvider seems to init correctly, and error reporting works fine as well.
I've done some digging around, and the only case I found where this error was reported was within the rollbar repo itself. Unsure if they are related.
https://github.com/rollbar/rollbar.js/issues/98
I should add that if I don't use ng-rollbar, and just add the rollBar config as part of a script tag on my index page. then I don't encounter the issue. But I'd prefer to use your wrapper.
having the same issue here, when injecting the RollbarProvider
into the angular app's config all the karma unit tests fail as if the module wouldn't have been instantiated.
I just updated to version 2.3.1. Could you please check if this issue still exists?
May be I'm doing something wrong. I updated my bower.json
to include ng-rollbar 2.3.1, and it cactually broke my app because a syntaxt error in ng-rollbar.js
.
running my unit tests:
SyntaxError: Unexpected string ".split("
at http://localhost:8080/base/bower_components/ng-rollbar/ng-rollbar.js?6c2cfe3a298c586ea111b8d14da58f20ba2bfb44:32
And in the referenced line: (32):
estEventTarget,XMLHttpRequestUpload".split(",");for(n=0;n<a.length;++n)t=a[n],r[t]&&r[t].prototype&&l(o,r[t].prototype,e)}}function l(r,o,e){if(o.hasOwnProperty&&o.hasOwnProperty("addEventListener")){for(var n=o.addEventListener;n._rollbarOldAdd&&n.belongsToShim;)n=n._rollbarOldAdd;var t=function(o,e,t){n.call(this,o,r.wrap(e),t)};t._rollbarOldAdd=n,t.belongsToShim=e,o.addEventListener=t;for(var a=o.removeEventListener;a._rollbarOldRemove&&a.belongsToShim;)a=a._rollbarOldRemove;var l=function(r,o,e){a.call(this,r,o&&o._rollbar_wrapped||o,e)};l._rollbarOldRemove=a,l.belongsToShim=e,o.removeEventListener=l}}r.exports={captureUncaughtExceptions:e,captureUnhandledRejections:t,wrapGlobals:a}},function(r,o){"use strict";function e(r,o){this.impl=r(o,this),this.options=o,n(e.prototype)}function n(r){for(var o=function(r){return function(){var o=Array.prototype.slice.call(arguments,0);if(this.impl[r])return this.impl[r].apply(this.impl,o)}},e="log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleUnhandledRejection,_createItem,wrap,loadFull,shimId,captureEvent,captureDomContentLoaded,captureLoad".split(","),n=0;n<e.length;n++)r[e[n]]=o(e[n])}e.prototype._swapAndProcessMessages=function(r,o){this.impl=r(this.options);for(var e,n,t;e=o.shift();)n=e.method,t=e.args,this[n]&&"function"==typeof this[n]&&("captureDomContentLoaded"===n||"captureLoad"===n?this[n].apply(this,[t[0],e.ts]):this[n].apply(this,t));return this},r.exports=e},function(r,o){"use strict";r.exports=function(r){return function(o){if(!o&&!window._rollbarInitialized){r=r||{};for(var e,n,t=r.globalAlias||"Rollbar",a=window.rollbar,l=function(r){return new a(r)},i=0;e=window._rollbarShims[i++];)n||(n=e.handler),e.handler._swapAndProcessMessages(l,e.messages);window[t]=n,window._rollbarInitialized=!0}}}}]);
Se the weird double quote after XMLHttpRequestUpload?
Minification issue?
Sorry, just published 2.3.2 which should fix the syntax error...
No worries @tandibar
I tried with 2.3.2
and a different error pop out:
SyntaxError: Parser error at http://localhost:8080/base/bower_components/ng-rollbar/ng-rollbar.js?b1121f80396b5c7fc4fe8d2f0a3717576e31612b:129
This looks odd, BTW https://github.com/tandibar/ng-rollbar/blob/master/ng-rollbar.js#L107
@fmquaglia try again with version 2.3.2a, you probably came across a typo in the code.
Now 2.3.3
Let me know if that fixed it, otherwise I'll reopen
@jpike88 2.3.3 still had a weird syntax error, however 2.3.5 worked like a charm.
Thank you so much!
No worries!