# Haxe 4.2.4 and colyseus-haxe problem

**URL:** <https://community.haxe.org/t/haxe-4-2-4-and-colyseus-haxe-problem/4763>\
**Category:** Haxe\
**Created:** [February 2, 2026, 6:11am UTC](https://community.haxe.org/t/haxe-4-2-4-and-colyseus-haxe-problem/4763 "2026-02-02T06:11:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jul](https://avatars.discourse-cdn.com/v2/letter/j/41988e/32.png) [@jul](https://community.haxe.org/u/jul)\
**Post date:** [February 2, 2026, 6:11am UTC](https://community.haxe.org/t/haxe-4-2-4-and-colyseus-haxe-problem/4763/1 "2026-02-02T06:11:13Z")

</div>

I’m trying to use this:

> **[GitHub - colyseus/colyseus-haxe: ⚔ Colyseus Multiplayer SDK for Haxe](https://github.com/colyseus/colyseus-haxe)**
>
> ⚔ Colyseus Multiplayer SDK for Haxe

However I get the following error when I try to compile with “lime test html5” :

`../../src/io/colyseus/serializer/schema/Decoder.hx:326: characters 34-35 : Unexpected ?`

 ![Screenshot from 2026-02-02 07-10-06](https://community.haxe.org/uploads/default/original/2X/1/1074be84d9d09023c0a279e8518dc07e2746e155.png)

Any idea/workaround to fix this?

---

<div class="post-metadata">

**Author:** ![kevin-kmetz](https://community.haxe.org/user_avatar/community.haxe.org/kevin-kmetz/32/2522_2.png) [@kevin-kmetz](https://community.haxe.org/u/kevin-kmetz)\
**Post date:** [February 2, 2026, 7:22am UTC](https://community.haxe.org/t/haxe-4-2-4-and-colyseus-haxe-problem/4763/2 "2026-02-02T07:22:40Z")

</div>

I looked at the docs for null coalescing here ( [Null coalescing - Haxe - The Cross-platform Toolkit](https://haxe.org/manual/expression-null-coalesce.html) ) and it seems it was introduced in Haxe version 4.3.0, which is later than the version you are using. Your compiler thus only knows of ‘?’ in the context of the ternary operator, and isn’t expecting a second ‘?’, since it isn’t yet part of its grammar.

You should be able to rewrite that specific line just without the null coalescing operator, as something like:

```haxe
? (previousValue != null ? previousValue : refs.get(refId))

```

I’m guessing that should work. I’m not setup to run a different version of the compiler at the moment, otherwise I would test it myself.

Edit: Oh, and I suppose it goes without saying that updating to the most recent (stable) version of Haxe would be a natural remedy, but I wrote my answer under the assumption that there may be a reason that you need to be on Haxe 4.2.4 in particular. If that isn’t the case, then updating would be ideal.

---

<div class="post-metadata">

**Author:** ![jul](https://avatars.discourse-cdn.com/v2/letter/j/41988e/32.png) [@jul](https://community.haxe.org/u/jul)\
**Post date:** [February 13, 2026, 9:49am UTC](https://community.haxe.org/t/haxe-4-2-4-and-colyseus-haxe-problem/4763/3 "2026-02-13T09:49:50Z")

</div>

Thx for your reply

Haxe 4.3.0 isn’t in Linux Mint repos, only 4.2.4 is available unfortunately, so I’ve upgraded using:

> sudo add-apt-repository ppa:haxe/releases -y  
> sudo apt-get update  
> sudo apt-get install haxe -y

Which upgraded haxe to 4.3.6

Followed the instructions in the git repo above for “Compiling the demo project to html5” and “Running the server” and it works. And it works even better by “Running the server” first and “Compiling the demo project to html5” after. Of course.

 ![Screenshot from 2026-02-13 10-49-08](https://community.haxe.org/uploads/default/original/2X/b/bb67907029753fa82de8d44d2bc42cfcbfddf41a.png)

---

<div class="post-metadata">

**Author:** ![tokiop](https://avatars.discourse-cdn.com/v2/letter/t/bc8723/32.png) [@tokiop](https://community.haxe.org/u/tokiop)\
**Post date:** [February 13, 2026, 12:58pm UTC](https://community.haxe.org/t/haxe-4-2-4-and-colyseus-haxe-problem/4763/4 "2026-02-13T12:58:19Z")

</div>

Hi jul, great that you manage to upgrade and compile ! 🥳 You might be interested in [lix](https://github.com/lix-pm/lix.client) which allows to manage dependencies (haxe version, libs..) on a per-project basis, which makes them independent from each other and from what is installed/available on the system, now or in a few years. It’s lightweight, well maintained and a real time-saver in my experience 🙂
