Skip to content

CommonJS import does not work with moduleResolution: "node" #227

@jackbonaguro

Description

@jackbonaguro

Related to #114

Trying to use the library in a ts-node project. The project needs to use { "moduleResolution": "node" } in its tsconfig.json, as many modules (socket.io specfically) require it.

Example: https://github.com/jackbonaguro/geckos-v2-cjs-example

While geckos.io can be imported in Common.js, changing this line in tsconfig.json breaks the import with the same ERR_REQUIRE_ESM as if it were imported as an ESM module.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions