[SOLVED] Error when compiling Hello World on Windows


Hi everyone!

heaps.io looks amazing! I wanted to try it, I have Haxe Compiler v3.4.7 installed, I have followed the instructions on how to install it (without HashLink for now). When I try to build the program, I get the following in the terminal:

> Executing task: C:\HaxeToolkit\haxe\haxe.exe --connect 6000 compile.hxml <

C:\HaxeToolkit\haxe\lib\heaps/1,6,1/hxd/Window.js.hx:21: characters 15-34 : Type not f
ound : js.html.EventTarget
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

My compile.hxml looks like this:

-lib heaps
-js hello.js
-main Main

And my Main.hx is the same as in the default example:

class Main extends hxd.App {
    override function init() {
        var tf = new h2d.Text(hxd.res.DefaultFont.get(), s2d);
        tf.text = "Hello World !";
    static function main() {
        new Main();

Here’s a list of all my haxelib packages (I had OpenFl installed previously):

C:\Users\ASUS>haxelib list
actuate: 1.8.7 [1.8.9]
bezier: [1.0.4]
box2d: [1.2.3]
format: [3.4.2]
haxelib: [3.3.0]
heaps: [1.6.1]
hldx: [1.9.0]
hlopenal: [1.5.0]
hlsdl: [1.9.0]
hxcpp-debug-server: [dev:c:\Users\ASUS\.vscode\extensions\vshaxe.hxcpp-debugger-1.2.4\hxcpp-debug-server]
hxcpp: [4.0.4] 4.0.8
hxp: [1.1.2]
layout: [1.2.1]
lime-samples: [7.0.0]
lime: 7.0.0 7.2.0 7.2.1 [7.3.0]
openfl-gpg: [1.4.3]
openfl-samples: 8.4.0 [8.7.0]
openfl: 8.4.0 8.7.0 8.8.0 [8.9.0]

In conclusion, heaps 1.6.1 is installed, but this error makes no sense: Type not found : js.html.EventTarget

Any idea on how to fix it?


Hm, that’s odd, Haxe 3.4.7 should have a js.html.EventTarget: https://github.com/HaxeFoundation/haxe/blob/3.4.7/std/js/html/EventTarget.hx

Is that file missing for you? (default location is C:\HaxeToolkit\haxe\std\js\html\EventTarget.hx)
Perhaps try re-running the Haxe installer?


Thanks! Yes, that file was missing indeed. I re-installed Haxe 3.4.7 in the same location (C:\HaxeToolkit) and now everything works great!

I think the issue was that there was a different haxe version installed, and somehow it was still listed as 3.4.7. Here’s the previous command line output:

Haxe Compiler 3.4.7 - (C)2005-2017 Haxe Foundation
 Usage : [...]

Now if I type “haxe” in command prompt I get the exact same thing, but somehow it compiles properly now… :stuck_out_tongue:

Again, thank you very, very much!!