jsSHA is not defined

0 votes
Got the question title error when tring to execute a scopeboardService.saveUserScore(). There is no record of the error message anywhere or what it means
asked Nov 6, 2014 in App42 Cloud API-BaaS by Kenny Arneaud (15 points)
Hello Kenny,

Can you please let me know which SDK/platform you are on? Also, what is the error message you are getting? Code snippet would be a great help here.
 
Thanks,
Himanshu Sharma
I'm using the Javascript SDK 2.8 with requrieJS


The debug error stack is

Uncaught ReferenceError:
jsSHA is not defined app42.all.min.js:1
post app42.all.min.js:1
App42ScoreBoard.saveUserScore


The code I'm using is

var scoreBoard = new App42ScoreBoard();
scoreBoard.saveUserScore('bartendergame',binder.scope.user.id,binder.scope.bottlesOpened,{success:function(){
                        console.log('arguments success');
                        console.log(arguments);
                    }, error: function(){
                        console.log('arguments error');console.log( arguments);


Neither success or error fires off.
                    }});
seems its at line var o = new jsSHA(sortAssoc(t), "ASCII"); 6045

1 Answer

0 votes
 
Best answer
After digging around the error seems to be here 
 
 "function" === typeof define && typeof define.amd ? 
    define(function () {
    return t    }) 
    : "undefined" !== typeof exports ?
    "undefined" !== typeof module && module.exports ? module.exports = exports = t 
    : exports = t 
    : this.jsSHA = t
 
I'm using requireJS and the define() returns t which I was unaware of 
answered Nov 6, 2014 by Kenny Arneaud (15 points)
selected Nov 19, 2014 by Kenny Arneaud
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...