flex-layout icon indicating copy to clipboard operation
flex-layout copied to clipboard

[resolved] RxJS 6.3.0 breaks angular flex layout

Open skiabox opened this issue 8 years ago • 79 comments

I just tried to use rxjs 6.3.0 and it seems that it breaks angular flex-layout so I returned to RxJS 6.2.2

skiabox avatar Aug 30 '18 15:08 skiabox

ERROR in node_modules/@angular/flex-layout/core/typings/observable-media/observable-media.d.ts(11,14): error TS2416: Property 'subscribe' in type 'ObservableMedia' is not assignable to the same property in base type 'Subscribable<MediaChange>'.
  Type '(next?: (value: MediaChange) => void, error?: (error: any) => void, complete?: () => void) => Sub...' is not assignable to type '{ (observer?: PartialObserver<MediaChange>): Unsubscribable; (next?: (value: MediaChange) => void...'.
    Types of parameters 'next' and 'observer' are incompatible.
      Type 'PartialObserver<MediaChange>' is not assignable to type '(value: MediaChange) => void'.
        Type 'NextObserver<MediaChange>' is not assignable to type '(value: MediaChange) => void'.
          Type 'NextObserver<MediaChange>' provides no match for the signature '(value: MediaChange): void'.

Same, also reverted to 6.2.2 to fix the build.

bhundven avatar Aug 30 '18 16:08 bhundven

@skiabox what version of @angular/flex-layout are you using? Bec, I'm getting the same error. Thanks.

lexcaraig avatar Aug 31 '18 01:08 lexcaraig

So here's the rub: RxJS v6.3 introduced a change to the Subscribable interface, which is what ObservableMedia extends. As a result, the type errors you've all been getting have surfaced leading to the bad builds.

I've patched this in #828 and once it gets merged we will cut the beta 18 release (likely early tomorrow). Apologies to everyone for the inconvenience. The workaround until then is to downgrade RxJS to v6.2.

CaerusKaru avatar Aug 31 '18 01:08 CaerusKaru

Although this issue is fixed, I'm going to reopen it until the new release has been published for visibility.

CaerusKaru avatar Aug 31 '18 01:08 CaerusKaru

Can confirm and thanks for the quick fix in. #828

x7even avatar Aug 31 '18 06:08 x7even

Thank for this, I still waiting for the the new release has been published

vuthanhvien avatar Aug 31 '18 10:08 vuthanhvien

I am having the same issue with rxjs at 6.2.2 and flex-layout at 6.0.0-beta.16

ERROR in node_modules/@angular/flex-layout/core/typings/observable-media/observable-media.d.ts(11,14): error TS2416: Property 'subscribe' in type 'ObObservableMedia' is not assignable to the same property in base type 'Subscribable<MediaChange>'.

dale-french avatar Aug 31 '18 10:08 dale-french

I've updated rxjs to 6.3 and Typescript to 2.9 but still not working, tried also downgrading to 6.0.0-beta.16 but still not working.

Seems like the fix is not released yet! Any update on this issue please ?

soufiane-fadil avatar Aug 31 '18 10:08 soufiane-fadil

@bloodymind I updated to rxjs 6.3 and then downgraded again to rxjs 6.0.0. Weird but it worked for me

sahilt75 avatar Aug 31 '18 11:08 sahilt75

@sahilt75, Please share all dependencies and devDependencies

mkginfo avatar Aug 31 '18 14:08 mkginfo

Version 6.0.0-beta.18 has been published on NPM. Please update to resolve this issue.

CaerusKaru avatar Aug 31 '18 17:08 CaerusKaru

With the beta.18 release I now see this error:

ERROR in node_modules/@angular/flex-layout/extended/typings/style/style.d.ts(72,67): error TS1144: '{' or ';' expected.
node_modules/@angular/flex-layout/extended/typings/style/style.d.ts(74,5): error TS1128: Declaration or statement expected.
node_modules/@angular/flex-layout/extended/typings/style/style.d.ts(74,33): error TS1005: ';' expected.
node_modules/@angular/flex-layout/extended/typings/style/style.d.ts(74,39): error TS1109: Expression expected.
node_modules/@angular/flex-layout/extended/typings/style/style.d.ts(79,5): error TS1128: Declaration or statement expected.
node_modules/@angular/flex-layout/extended/typings/style/style.d.ts(80,1): error TS1128: Declaration or statement expected.

jgeiger-cr avatar Aug 31 '18 17:08 jgeiger-cr

+1. Same issue as jgeiger-cr

jrosseel avatar Aug 31 '18 17:08 jrosseel

Please provide a minimal reproduction, I'm not seeing this on our internal tests. Also please try a clean uninstall/reinstall.

CaerusKaru avatar Aug 31 '18 17:08 CaerusKaru

Sorry, I'm using TS ~2.7.2, Angular ^6.1.6, and already tried a fresh NPM install.

jgeiger-cr avatar Aug 31 '18 17:08 jgeiger-cr

Not sure if it's related to the same issue but I did a clean install with npm instead of Yarn and it built fine

dale-french avatar Aug 31 '18 17:08 dale-french

I just installed it successfully on our StackBlitz online (tried with both TS 2.7.2 and TS 2.9.2). If you're facing an install/build issue after upgrading, it's likely the install step didn't work correctly.

CaerusKaru avatar Aug 31 '18 18:08 CaerusKaru

after updating the version number for flex-layout in package.json, the following worked for me: npm install reinstall @angular/flex-layout

P.S. I kept RXJS @ 6.3.1 and it still worked

sheariley avatar Aug 31 '18 18:08 sheariley

4 of our developers independently see the same problem with fresh NPM installs on Macs, Windows, Linux. Even IntelliJ sees the errors in node_modules/@angular/flex-layout/extended/typings/style/style.d.ts

flex error

jgeiger-cr avatar Aug 31 '18 18:08 jgeiger-cr

Ok I see it now. The import syntax is new for TS, and only works with TS 2.9. The workaround is to bump to TS 2.9 as well while we consider options internally.

However, it might be the case that this is the terminal stage in our support for TS 2.7 (ie if you want to use RxJS 6.3, you also need to bump to TS 2.9).

CaerusKaru avatar Aug 31 '18 18:08 CaerusKaru