-
Notifications
You must be signed in to change notification settings - Fork 3k
npm linking consumer with library causes TS2322: Observable not assignable to Observable #1744
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
Comments
It's probably that both libraries should have |
Unfortunately having I am unsure how to fix this (besides explicitly installing typings in the consumer) and I don't quite understand why this is not an issue for more people? Aren't more people npm linking different libraries like this and running into this same problem? Not sure what I'm missing. |
@vankeer oh, to clarify, this is a TypeScript build failure? cc/ @david-driscoll |
I believe it's an issue with the compiler still. I get the issue as well. Work around is pretty easy, at least for working locally. Just make a I'll test with typescript@next and see if its been resolved.
|
@Blesh Yup, it's a Typescript build failure. Thanks for following up this issue @david-driscoll Thanks for your response. Using typescript@next did not solve the issue for me. Also, I'm not sure what you mean with installing rxjs and symbol-observable in the parent dir to fix the issue, since that alone is not enough to fix it for me. But, deleting It's a bit of a hassle, especially when working with lots of libraries, but it's another workaround for this issue, other than installing typings explicitly. |
This may be a decent case to give a change like #1741 a second look. |
I think this microsoft/TypeScript#6496 is related, unclear if it's gonna be fixed from the TS side. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
RxJS version: 5.0.0-beta.6 and also tried npm linking with master today - no change
Code to reproduce:
You need:
npm link
the two before buildingExample:
Expected behavior:
The library and the consumer build normally.
Actual behavior:
The consumer throws this error:
Additional information:
This only happens when
npm link
ing the repos.One way to avoid this problem is by having rxjs methods return an interface for Observable instead of Observable. Of course, this would require a rather large refactoring. PR for this suggested change: #1741
Another way to avoid the problem is by explicitly installing the typings in the consumer (have not managed to do this yet with this specific example though).
The text was updated successfully, but these errors were encountered: