Rxjs: issue when importing/using Rxjs with 5.5.3 version

Created on 3 Dec 2017  路  13Comments  路  Source: ReactiveX/rxjs

RxJS version:
5.5.3

Code to reproduce:
import Rx from 'rxjs/Rx'; //same with from 'rxjs'
let observable = new Rx.Subject();

Expected behavior:
a new Rx.Subject is created

Actual behavior:
no Rx.Subject is created, get an error:
TypeError: Cannot read property 'Subject' of undefined

Additional information:
This was working fine with 5.5.2 code, and broke with 5.5.3
node v8.9.1
breaks when running using babel, ex: node -r babel-register foo.js
works when running es modules nativly, ex: node --experimental-modules foo.mjs

Most helpful comment

But this is a breaking change for many people and should have been versioned accordingly.

It is a regression, not an intentional breaking change. We'll try to get it fixed as soon as we can.

All 13 comments

This may related with https://github.com/ReactiveX/rxjs/pull/3025, haven't verified though. /cc @jasonaden .

Can be fixed by doing import * as Rx from "rxjs/Rx".

The documentation should be fixed to reflect this, since the default import is still used in https://github.com/ReactiveX/rxjs#installation-and-usage

Has import of the default been deprecated/removed or will it this be fixed in 5.5.4?

Quick fix:
Path should be changed from rxjs/operators/index.js to rxjs/operators.js

But this is a breaking change for many people and should have been versioned accordingly. What are the plans for for 5.5.4?

But this is a breaking change for many people and should have been versioned accordingly.

It is a regression, not an intentional breaking change. We'll try to get it fixed as soon as we can.

The steps above don't repro the issue for me. Can someone please provide a way to reproduce this? Ideally create a repo with the problem so we can clone and see the issue. There must be something with environments or tools that I'm not seeing when simply using the above steps.

@srcook1 @askielboe @salemdar

rxjs/operators/index.js is missing in rxjs 5.5.3 That seems to be the culprit in breaking our build. This should not have been changed! Now we have a library that was built on 5.5.2 that is breaking.

I can verify this happening on React Native.

same problem here.

Apparently 5.5.3 was built with the wrong (newer) version of TypeScript, and that's what's causing the issue. Will build properly and publish again soon.

This should be resolved in 5.5.4 now.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chalin picture chalin  路  4Comments

jakovljevic-mladen picture jakovljevic-mladen  路  3Comments

marcusradell picture marcusradell  路  4Comments

OliverJAsh picture OliverJAsh  路  3Comments

giovannicandido picture giovannicandido  路  4Comments