Non-UserCodeError: TypeError: undefined is not a function


#1

I’ve submitted code which triggers a console error of “Non-UserCodeError: TypeError: undefined is not a function”

This causes the game to never load, and I can’t seem to enter a game to attempt to fix.

Full trace

|Athena's Archer| Non-UserCodeError: TypeError: undefined is not a function
TypeError: undefined is not a function
    at new t (http://codecombat.com/javascripts/world.js:1279:173)
    at t.i.exports.t.getState (http://codecombat.com/javascripts/world.js:1265:75)
    at t.i.exports.t.setState (http://codecombat.com/javascripts/world.js:1406:94)
    at new t (http://codecombat.com/javascripts/world.js:1402:135)
    at t.i.exports.t.getNextFrame (http://codecombat.com/javascripts/world.js:1405:10)
    at World.module.exports.World.getFrame (http://codecombat.com/javascripts/world.js:1330:52)
    at World.module.exports.World.loadFrames (http://codecombat.com/javascripts/world.js:1337:71)
    at http://codecombat.com/javascripts/world.js:1338:339 

Edit:

Managed to test code on another account. This happens if I try to modify a coins properties (specifically pos). I see now that these are read only properties, but attempting to change them shouldn’t crash the game (and make it impossible to fix :frowning:) .

I still can’t get to an edit panel on my account so if you could clear my code it would be appreciated.


#2

Recovered, sorry about that. Working to make the error recoverable now.


#3

I got Inifinite code warning during loading of Zero Sum level (one of my lost battles). Battle playback failed with following error:

|Tengri’s Cyril| Loaded 463 of 960 (+1263ms)
(program):6 |Tengri’s Cyril| Loaded 469 of 960 (+1066ms)
(program):6 |Tengri’s Cyril| Non-UserCodeError: TypeError: undefined is not a function
TypeError: undefined is not a function
at t.eval (eval at (http://codecombat.com/javascripts/world.js:329:20), :144:65)
at t.CastsRaiseDead.raisedChooseAction [as chooseAction] (eval at (http://codecombat.com/javascripts/world.js:329:20), :149:8)
at Action.update (eval at (http://codecombat.com/javascripts/world.js:329:20), :41:19)
at t.e.exports.t.getNextFrame (http://codecombat.com/javascripts/world.js:391:100)
at World.module.exports.World.getFrame (http://codecombat.com/javascripts/world.js:293:52)
at World.module.exports.World.loadFrames (http://codecombat.com/javascripts/world.js:302:10)
at http://codecombat.com/javascripts/world.js:299:172
(program):24 Uncaught TypeError: Cannot read property ‘shift’ of null
(program):6 |Tengri’s Cyril| Worker initialized after 1058ms
2(program):645 Cannot show action build for Gold Cloud because it DNE
(program):645 Cannot show action mana-blast for Sorcerer because it DNE


#4

How about now? I just made the raise-dead logic a little more robust to raising dead units that can’t see, but I’m not sure that was it. (Did you raise a chest or something, possibly?)


#5

@Nick, thanks for a fast fix. I’ve checked a dozen of fights, no sight of that issue