Html5 nil property (DEF-3648) (SOLVED)

Testing on a clean project, using Windows 10:

go.property ("test", 1)

function init (self)
	print (self.test)
end

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.
defold8

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 go.property 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

go.property ("test", 1)

to

go.property("test", 1)

Seems our parser for go properties is very picky.

5 Likes

Wow, that works! Thanks!

3 Likes

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

4 Likes

Solved in 1.2.170