Html5 nil property (DEF-3648) (SOLVED)

Testing on a clean project, using Windows 10: ("test", 1)

function init (self)
	print (self.test)

Using the Defold editor 1.2.142, the output is 1.
With the html5 build, the output is nil.

Is this a property bug in the html5 build?

1 Like

How are you building HTML5? By bundling or by Project->Build HTML5 in the editor?

Project Build HTML5 in the editor. Is it supposed to work differently?

Printing is only enabled for debug builds, but that should be fine when launching directly from the editor. Do you see other log outputs from the engine (check the browser’s javascript console)? You will usually see something like this near the top.

INFO:ENGINE: Defold Engine 1.2.142 (6230c40)
1 Like

Here’s for Project->Build from the editor.

Here’s for Project->Build HTML5 from the editor, then opened browser console (using Google Chrome).

I was testing my project and was wondering why some things are not running right in the html5 build. Looks like this is the culprit (nil properties). In the meantime, I just moved them out of and just initialize with self.var as a temporary workaround.

I got the correct value 1:

But something are still red.

OK, try removing the extra spaces between function names and arguments, e.g. change ("test", 1)

to"test", 1)

Seems our parser for go properties is very picky.


Wow, that works! Thanks!


Great! I created ticket DEF-3648 to track this.


Solved in 1.2.170