Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[HELP] Error: Firebase.child failed: First argument must be a non-empty string and can't contain ".", "#", "$", "[", or "]".

February 22 (11 years ago)
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
if(msg.content == "!turn180"){rotateTile(msg, 180);};


rotateTile = function(msg, degree) {
var selectedObjs = msg.selected;
_.each(selectedObjs, function(obj) {
if(obj._type == 'graphic'){
var token = getObj('graphic', obj._id);
var rotation = token.get("rotation");
rotation = rotation + degree;
token.set({rotation: rotation});
};
});
};

Just turning a tile... and sometimes getting:

/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:1 orts, require, module, __filename, __dirname) { function f(a){throw a;}var j=v ^ Error: Firebase.child failed: First argument must be a non-empty string and can't contain ".", "#", "$", "[", or "]". at Error (<anonymous>) at Ha (/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:12:204) at G.W.H (/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:126:213) at TrackedObj._doSave (
/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:1
orts, require, module, __filename, __dirname) { function f(a){throw a;}var j=v
^
Error: Firebase.child failed: First argument must be a non-empty string and can't contain ".", "#", "$", "[", or "]".
at Error (<anonymous>)
at Ha (/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:12:204)
at G.W.H (/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:126:213)
at TrackedObj._doSave (

Any thoughts?
February 22 (11 years ago)
Alex L.
Pro
Sheet Author

Stephen S. said:

if(msg.content == "!turn180"){rotateTile(msg, 180);};


rotateTile = function(msg, degree) {
var selectedObjs = msg.selected;
_.each(selectedObjs, function(obj) {
if(obj._type == 'graphic'){
var token = getObj('graphic', obj._id);
var rotation = token.get("rotation");
rotation = rotation + degree;
token.set({rotation: rotation});
};
});
};

Just turning a tile... and sometimes getting:

/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:1 orts, require, module, __filename, __dirname) { function f(a){throw a;}var j=v ^ Error: Firebase.child failed: First argument must be a non-empty string and can't contain ".", "#", "$", "[", or "]". at Error (<anonymous>) at Ha (/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:12:204) at G.W.H (/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:126:213) at TrackedObj._doSave (
/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:1
orts, require, module, __filename, __dirname) { function f(a){throw a;}var j=v
^
Error: Firebase.child failed: First argument must be a non-empty string and can't contain ".", "#", "$", "[", or "]".
at Error (<anonymous>)
at Ha (/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:12:204)
at G.W.H (/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:126:213)
at TrackedObj._doSave (

Any thoughts?

token.set({"rotation": rotation});

rotateTile(msg, 180); would have tryed to do token.set({180: 180});
February 22 (11 years ago)
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Changed to:

rotateTile = function(msg, degree) {
var selectedObjs = msg.selected;
_.each(selectedObjs, function(obj) {
if(obj._type == 'graphic'){
var token = getObj('graphic', obj._id);
var newRotation = token.get("rotation");
newRotation = newRotation + degree;
token.set({"rotation": newRotation});
};
});
};

Same behavior...

For the random dungeon generator...

If I click "Create-Map-Layer" and then try to "Turn-Right-90-Degrees" using a token action for a tile....
I get the error...

If I then save the API to restart the sandbox and then to "Turn-Right-90-Degrees" for a tile with the token action on the same map....
It works...

It wont work that first go.... but always works after a save.... until a new map is created.

February 22 (11 years ago)
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter

[Bug] Error with setting properties of objects created with createObj

Seems to be with created objects.