Javascript errors when trying to use Stock

Game development with Board Game Arena Studio
Post Reply
sparr
Posts: 65
Joined: 08 April 2014, 02:12

Javascript errors when trying to use Stock

Post by sparr »

I'm trying to copy some functionality from the Hearts example. The following line of code:

Code: Select all

this.playerHand.addToStockWithId( this.getCardUniqueId( color, number ), card.id );
which is being run with the following parameters:

Code: Select all

this.playerHand.addToStockWithId( 39, 1 );
is producing this error in a red notification at the top of the game interface:

Code: Select all

Javascript error:
During pageload
Cannot read property 'toString' of undefined
TypeError: Cannot read property 'toString' of undefined
at http://1.studio.boardgamearena.com:8081/data/themereleases/140706-1531/js/modules/layer/ly_studio.js:15:308691
at String.replace (native)
at Object._797.substitute (http://1.studio.boardgamearena.com:8081/data/themereleases/140706-1531/js/modules/layer/ly_studio.js:15:308491)
at _e41.updateDisplay (http://1.studio.boardgamearena.com:8081/data/themereleases/140706-1531/js/modules/layer/ly_studio.js:15:606691)
at _e41.addToStockWithId (http://1.studio.boardgamearena.com:8081/data/themereleases/140706-1531/js/modules/layer/ly_studio.js:15:604066)
at declare.setup (http://1.studio.boardgamearena.com:8081/data/themereleases/140706-1531/games/redseven/999999-9999//redseven.js?1418625925412:91:33)
at _56e.completesetup (http://1.studio.boardgamearena.com:8081/data/themereleases/140706-1531/js/modules/layer/ly_studio.js:15:182362)
at http://en.1.studio.boardgamearena.com/redseven?table=18729:696:24
at _c6 (http://1.studio.boardgamearena.com:8081/data/themereleases/140706-1531/js/dojoroot/dojo/dojo.js:15:11360)
at _36 (http://1.studio.boardgamearena.com:8081/data/themereleases/140706-1531/js/dojoroot/dojo/dojo.js:15:12971)
I'm having little success figuring out what I might be doing wrong with the Stock component that would lead to this. The minification of ly_studio.js makes it very hard to follow to see what is going wrong. I'd appreciate some insight, perhaps from someone with access to the un-minified ly_studio.js source?
sparr
Posts: 65
Joined: 08 April 2014, 02:12

Re: Javascript errors when trying to use Stock

Post by sparr »

I rolled back a large number of changes to my javascript and this problem went away. I kept a snapshot of the broken code, for future testing purposes if necessary.
Post Reply

Return to “Developers”