-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Internal typings dependency tree is disconnected #6175
Comments
Could you include a complete breakdown of the steps necessary to reproduce this and the versions and configurations - e.g. |
Reproduction is as little as I've mentioned originally: just two lines of code. As for the Correct narrowing down would be probably |
Closed by #6178 |
Bug Report
May be related to #3674 #4511 #4512 #4540
I'm opening the issue since they're either long time closed or have crazy ridiculous advices like "just downgrage, man". And also as a place to describe a possible temporary fix for those who might've had a similar setup.
Current Behavior
Import sub-component like 'rxjs/webSocket', but do not import 'rxjs'.
Partial usage of sub-components does not import all the dependent typing causing into compilation errors.
Expected behavior
If some typing requires some global interface being extended, then this extension should be explicitly defined.
I.e.:
type InteropObservable<T> = { [Symbol.observable]: () => Subscribable<T>; }
should explicitly import a module which declaresSymbol.observable
, and so on.(I am not aware of any other cases, but I do not know whether they exist or not)
Reproduction
Essentially the import itself will cause the issue but I've added the second line (the usage) just for a convenience. Personally I used it with
reconnecting-websocket
package (in which funnily I also had to patch some incorrect types).The error is following
Environment
Possible Solution
The actual cause is obvious: the declaration of
Symbol.observable
was not imported.Brief search pinpoints the Rx.d.ts file that contains the required declaration.
The minimal solution is as simple as that:
The workaround is simple, but it is still a workaround and the presence of the issue detects some internal inconsistency in the typings.
So for an actual fix as I mentioned above it'd be better to extract the "global" declarations somewhere and import them where necessary.
The text was updated successfully, but these errors were encountered: