Skip to content

[Bug]: When TypeScript target is "es2022", Server breaks #704

@freeqaz

Description

@freeqaz

Context

I'm guessing this breaks because of experimental decorators or something. This was a head scratcher and I'm opening this ticket to help others avoid the debugging pain that I went through to isolate this issue. (copy pasted code around a bunch to make a minimal reproduction environment)

I'm not sure if this is a bug for y'all to deal with or if it's just something that should have a warning added to the docs. Either way, I hope this saves somebody some time!

Bug description

If I set "target": "es2022" in my tsconfig.json, Colyseus breaks.

Reproduction

No response

Steps to reproduce

  1. Clone this example repo: https://github.com/PatBG/tutorial-phaser-colyseus
  2. Run the server and client, observe it working.
  3. Set target to es2022 in tsconfig.json. (change is from es6)
  4. Observe the server breaking. Messages don't update state on the server for some reason.

Environment & Versions

Colyseus: 0.15.0
Node: v18.19.1
Typescript: 4.9.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions