Html5 nil property (DEF-3648) (SOLVED)

#1

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

#2

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

0 Likes

#3

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

0 Likes

#4

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

#5

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.

0 Likes

#6

I got the correct value 1:

But something are still red.

0 Likes

Error in HTML build (SOLVED)
#7

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

#8

Wow, that works! Thanks!

3 Likes

#9

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

4 Likes

#10

Solved in 1.2.170

0 Likes