-
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
Rxjs use of instanceof breaks subscription with multiple bundles #3828
Comments
It sounds like you're bundling two instances of RxJS. That's not going to be good for your app size. Your libraries shoudl have RxJS as a peer dependency, and that will solve the problem most likely. However, there are workarounds:
... but the real solution here is that you'd want RxJS to be a peer dependency. |
We might start using our |
Thank you for the help Ben! Yes, our current setup isn't ideal. Your suggestions will have to serve as a band aid for the time being until we get our distribution setup sorted out. |
After some discussion with the team today, we've decided to leave the
|
Bug Report
Current Behavior
Hi, we are building a components that exposes rxjs observables for plugins to connect to. Our component is primarely used prebundled, which means that our plugin creators might have double of some parts of rxjs. Though, somewhat wastefull this worked fine with rxjs 5, but after upgrading to rxjs 6, things started breaking in Firefox and Chrome Canary 69. Here's the error message they get when trying to subscribe:
Which pointed at the subscribeTo function, where I suspect that this line is the culprit:
rxjs/src/internal/util/subscribeTo.ts
Line 15 in 80ceea0
instanceof
seems to be a bit unreliable and appears to work differently under the hood in each browser, especially if the class appears twice and originated from the same source.Reproduction
Expected behavior
Should subscribe since there is nothing (?) stopping it from doing so.
Environment
If anyone knows a workaround I'd be happy with that, since I know some would probably regard this as a non-issue.
The text was updated successfully, but these errors were encountered: