Skip to content

Types are not compatible with modern Node/TS projects #992

@FoxxMD

Description

@FoxxMD

I am the developer of multi-scrobbler a nodejs/typescript application that uses @jellyfin/sdk for getting music activity from jellyfin for scrobbling.

The current @jellyfin/sdk version (0.13.0) works at runtime with my project but typescript/vscode/IDEs complain that the package does not export anything for types.

Using Are The Types Wrong on 0.13.0 shows that resolution for modules within the package are incorrect for modern nodejs-based projects.

Image

Internal resolution error docs from Are The Types Wrong:

this problem can occur with tsc alone if the library author compiles with --moduleResolution node (also known as node10) or bundler, especially in combination with a package.json that has "type": "module"

JF sdk uses "moduleResolution": "Node" in tsconfig

Potentially also, since openapi cli is used to generate the sdk, the "Declarations and JavaScript are generated separately" cause may also apply

This can happen...where the types are generated via TypeScript (tsc or another tool calling its API) under certain settings, while the JavaScript is generated by another tool entirely, or by TypeScript under different settings.


I have a minimal reproduction of this issue here, foxxmd/jellyfin-repo, which requires only installing this package and using modern nodejs/ts presets for tsconfig.

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