Skip to content
This repository was archived by the owner on Jul 15, 2023. It is now read-only.

Getting FIREBASE WARNING: Exception was thrown by user callback. TypeError: cb is not a function #9

@ankitshekhawat

Description

@ankitshekhawat

Getting this warning on initialization:

FIREBASE WARNING: Exception was thrown by user callback. TypeError: cb is not a function
    at success (/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/botkit-storage-firebase/src/index.js:50:13)
    at c (/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/firebase/lib/firebase-node.js:240:58)
    at /Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/firebase/lib/firebase-node.js:201:710
    at ec (/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/firebase/lib/firebase-node.js:52:165)
    at ac (/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/firebase/lib/firebase-node.js:31:216)
    at $b (/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/firebase/lib/firebase-node.js:30:1198)
    at Ri (/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/firebase/lib/firebase-node.js:224:313)
    at X.h.Gb (/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/firebase/lib/firebase-node.js:238:140)
    at X.h.Og (/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/firebase/lib/firebase-node.js:240:249)
    at Object.get (/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/botkit-storage-firebase/src/index.js:47:31) 
/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/firebase/lib/firebase-node.js:52
(d="0"+d),c+=d;return c.toLowerCase()}var zd=/^-?\d{1,10}$/;function td(a){return zd.test(a)&&(a=Number(a),-2147483648<=a&&2147483647>=a)?a:null}function ec(a){try{a()}catch(b){setTimeout(function(){R("Exception was thrown by user callback.",b.stack||"");throw b;},Math.floor(0))}}function S(a,b){if(t(a)){var c=Array.prototype.slice.call(arguments,1).slice();ec(function(){a.apply(null,c)})}};function Ad(a){var b={},c={},d={},e="";try{var f=a.split("."),b=Pb(id(f[0])||""),c=Pb(id(f[1])||""),e=f[2],d=c.d||{};delete c.d}catch(g){}return{ph:b,Dc:c,data:d,bh:e}}function Bd(a){a=Ad(a).Dc;return"object"===typeof a&&a.hasOwnProperty("iat")?z(a,"iat"):null}function Cd(a){a=Ad(a);var b=a.Dc;return!!a.bh&&!!b&&"object"===typeof b&&b.hasOwnProperty("iat")};function Dd(a){this.Y=a;this.g=a.n.g}function Ed(a,b,c,d){var e=[],f=[];Na(b,function(b){"child_changed"===b.type&&a.g.Ad(b.Le,b.Ma)&&f.push(new H("child_moved",b.Ma,b.Ya))})

TypeError: cb is not a function
    at success (/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/botkit-storage-firebase/src/index.js:50:13)
    at c (/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/firebase/lib/firebase-node.js:240:58)
    at /Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/firebase/lib/firebase-node.js:201:710
    at ec (/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/firebase/lib/firebase-node.js:52:165)
    at ac (/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/firebase/lib/firebase-node.js:31:216)
    at $b (/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/firebase/lib/firebase-node.js:30:1198)
    at Ri (/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/firebase/lib/firebase-node.js:224:313)
    at X.h.Gb (/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/firebase/lib/firebase-node.js:238:140)
    at X.h.Og (/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/firebase/lib/firebase-node.js:240:249)
    at Object.get (/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/botkit-storage-firebase/src/index.js:47:31)

I am initialising it like this.

var Botkit = require('botkit'),
  firebaseStorage = require('botkit-storage-firebase')({firebase_uri: 'https://xxx.firebaseio.com/'}),
      controller = Botkit.slackbot({
          debug: true,
          storage: firebaseStorage
      });

// then you can use the Botkit storage api, make sure you have an id property
var beans = {id: 'cool', beans: ['pinto', 'garbanzo']};
controller.storage.teams.save(beans);
beans = controller.storage.teams.get('cool');
console.log(beans);

However I can see the database entry posted on firebase console succesfully. problem occurs only on
beans = controller.storage.teams.get('cool');

Any idea how to get around this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions