Skip to content

[Bug]: 10.0.0 types inferred as any break compilation #2341

Description

@agross

I'm sure that

  • This issue is still present in the current beta version of this adapter
  • There is no other (open) issue with the same topic (use the search!)
  • This issue is not described in the adapter documentation / FAQ (read the docs!)

Script type

TypeScript

The problem

My scripts heavily rely on rxjs. I need to use rxjs 6.x because newer versions don't work with ioBroker.javascript.

ioBroker.javascript 9.3.1 with rxjs@6 installed works fine with this piece of simplistic code:

import { Observable } from 'rxjs';

new Observable<string>(observer => { })

The code compiles and runs, despite the observer type not being inferred.

Image

Not an issue for me because I write my scripts in VS Code:

Image

With ioBroker.javascript 10, the same code no longer compiles:

TypeScript compilation failed:
new Observable<string>(observer => { });
                       ^
ERROR: Parameter 'observer' implicitly has an 'any' type.

With explicit types, compilation does succeed (VS Code accepts it too, so does tsc):

import { Observable, Subscriber } from 'rxjs';

new Observable<string>((observer: Subscriber<string>) => {});

Why does type inference no longer work and now cause compiler errors?

iobroker.current.log (in debug mode!)

No response

Version of nodejs

22.22

Version of ioBroker js-controller

7.2.2

Version of adapter

10.0.0

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