Haxe 3.2 / openfl 3.1.0 / neko 2.0.0 "Constant expression expected"

ubuntu 14.04 x86/32bit.

I just installed haxe 3.2, ran haxelib upgrade and updated everything, ran lime setup, ran openfl setup, did “openfl create project xyzpdq” and then in there i did “openfl text neko” and i get failure and errors. Any thoughts / help / pointers would be appreciated. Thanks! (I did some searching but didn’t find anything that seemed like the answer.)

$ openfl test neko
/usr/lib/haxe/std/neko/_std/Xml.hx:366: characters 7-19 : Constant expression expected
/usr/lib/haxe/std/neko/_std/Xml.hx:25: lines 25-423 : Field nodeType has different type than in core type
/usr/lib/haxe/std/neko/_std/Xml.hx:25: lines 25-423 : XmlType should be XmlType
/usr/lib/haxe/std/neko/_std/Xml.hx:25: lines 25-423 : Field parent has different property access than core type

1 Like

Something seems very wrong with your Haxe installation itself,
I’d advice you to completely remove it and retry with a clean install.

I am experiencing this exact same error when using the “dox” library to generate documentation for HaxeFlixel. The “dox” documentation says that it needs to use haxe 3.1.3:

“Note: Dox currently requires v3.1.x branch of Haxe due to some minor changes in abstract rtti xml generation. You’ll also need an up to date haxelib (requires support for classPath in haxelib.json)”

Also, the haxe 3.2 breaking changes (https://github.com/HaxeFoundation/haxe/wiki/Breaking-changes-in-Haxe-3.2.0) references some Xml stuff, so that might be the problem? Regardless, I’ll probably be using haxe 3.1.3 until some of this gets resolved on either end…

Hope that helps.

Delete your /usr/lib/haxe/std directory and install again :slight_smile:

1 Like

Well, I’m not quite sure why manually deleting the std directory did it, but it worked! Something about my install process must not have been clearing that out properly. Thanks for the persistence :wink:

I just ran into this and the same solution worked for me. I wonder what it is about Haxe 3.2 and OpenFL 3.1.0 and Neko 2.0.0 that interact to cause this problem. (I’m on Ubuntu, btw)