Problem running Domkit and samples


I started learning Haxe and Heaps and am a little confused about how every pieces fits together.

I have two problems that are probably linked, but I am not sure.

First of all, I run Debian 9, Haxe 4.0.0-rc.3, Haxelib (3.3.0), Heaps (1.6.1) and Visual Studio Code (1.37.1).

As advised by Gama11 in another post, I installed Heaps using "haxelib git heaps" because I compiled Haxe from source and it was not working otherwise.

Now for the problems:

The first one is that I don’t understand how to use the Domkit. All other examples on this page contained the instructions and code needed for the example to work, but the instructions for the Domkit only give an example without complete instructions.

What I want to understand is what other files and configuration would I need for that example to work.

As it is, I only understand the use of the Main file based on the previous examples, but it doesn’t seem to be the appropriate place to put the example code in.

My second problem is that I don’t understand how to use the samples, and I believe it is probably a problem similar to the previous one. I am able to compile the applications using the instructions on the Heaps Github page and start the HTML version of it.

However, I want to work on them in Visual Code Studio, and I am not able to start them using it.

I only glossed over the Haxe manual but as said on the website, it is not a tutorial. I figured I could learn more of the structure and functioning using the samples, however, I am not able to run those yet.

I looked around on the forum, but the questions are generally about steps more advanced than what I am able to do as it is.

I am certain there are resources I haven’t found yet that could help me with that, so please accept my excuses if I am loosing your time.

If you have advice or learning resources to help me start, that would be great.

The only tutorial I saw for Haxe were either very basic introduction to programming, or outdated information. The most useful resources I found is Nicolas Cannasse video at the Haxe conference, but I still can’t figure how things work together.

Thank you in advance, and have a good day.

Hi everyone,
The solution was really simple, though it took me more time than to figure out than I am comfortable admitting.

For those who would still struggle with that, here are the instructions.

To use the samples, which Domkit is a part of, simply download the ‘samples’ folder from Github page ( and copy its content in your project folder.

Then follow the instruction given in the Hello World example on Heaps website, except you need to modify your compile.hxml file.

First, add the library you want to use after the heaps library, for example:
-lib heaps
-lib domkit

Finally, you need to change your ‘-main’ link to point to the example file you want to use:
-main Domkit

You can now compile and start your application with F5 or Shift+Ctrl+b.
Your application should open and show the example.

From there, I suppose you can learn quite a lot about how Heaps works.

I hope that will help someone one day.

Take care of yourselves and have a good one.

1 Like

I have some issues here myself. When I try to compile the samples folder (so the all.hxml), everything gets compiled except for the files using domkit. Even though I have Domkit installed (git-version). I get an error like this:

Domkit.hx:9: characters 3-14 : Unsupported code block
Domkit.hx:5: character 1 : Build failure
Domkit.hx:9: characters 3-14 : Unsupported code block
Domkit.hx:5: character 1 : Build failure
2 ERRORED : [domkit/domkit_hl,domkit/domkit_js]

The compiler is pointing to the first “object” in Domkit.hx

// Naming scheme of component classes can be customized with domkit.Macros.registerComponentsPath();
class ViewComp extends h2d.Flow implements h2d.domkit.Object {

	static var SRC =
	<view class="mybox" min-width="200" content-halign={align}>
		Hello World

It seems he doesn’t like the “Hello World” ?

Any suggestions? Thank you :slight_smile:

I re-tried with an individual “domkit.hxml”, but still, didn’t work …

-lib heaps
-lib hlsdl
-lib domkit
-main Domkit
-hl app.hl

However, Haxe Domkit itself seems to be working. When I open the directory containing Domkit in the Haxe library (haxelib path domkit). I can compile and run domkit:

C:\...\HaxeToolkit\haxe\lib\domkit\git\sample>haxe test.hxml
C:\...\HaxeToolkit\haxe\lib\domkit\git\sample>hl test.hl
Test.hx:45: Blue
Test.hx:46: 55
Test.hx:47: 0
Test.hx:48: Hello World!
Test.hx:54: 50
Test.hx:59: 60
Test.hx:61: null

Anyway, the output is not much of use… is it?

I have the same issue:

PS D:\projects\chaotive\haxe-playground> haxe .\compileHeaps.hxml
src/components/SampleView.hx:8: characters 13-25 : Unsupported code block
src/components/SampleView.hx:4: character 1 : Build failure

The sample has been fixed :wink:

1 Like