SolvedDefinitelyTyped @types/node observable declaration conflicts with rxjs

I'm seeing this error since @types/node 10.3.0 was published yesterday:

node_modules/@types/node/index.d.ts(167,14): error TS2687: All declarations of 'observable' must have identical modifiers.node_modules/rxjs/internal/symbol/observable.d.ts(4,9): error TS2687: All declarations of 'observable' must have identical modifiers

See also angular/angular#24245 and stackoverflow.com/q/50639530.

21 Answers

✔️Accepted Answer

If anyone needs an immediate fix, downgrading @types/node to 10.1.2 should work (this was the last release before updating observable to readonly).

Other Answers:

Seems ok with rxjs 6.2.2, not getting the error anymore.

Similar issue, except my conflict is with @types/zen-observable.

node_modules/@types/node/index.d.ts:167:14 - error TS2687: All declarations of 'observable' must have identical modifiers.

167     readonly observable: symbol;
                 ~~~~~~~~~~


node_modules/@types/zen-observable/index.d.ts:8:9 - error TS2687: All declarations of 'observable' must have identical modifiers.

8         observable: symbol;
          ~~~~~~~~~~

@mirkonasato Looks like you're correct, rxjs just hasn't updated yet, @types/node was updated 7 days ago (e22898d) but the corresponding update with rxjs (ReactiveX/rxjs@e1c203f) just authored 4 hours ago.

See ReactiveX/rxjs#3697 (comment)

I'm using aws-amplify and rxjs on a lambda, amplify installs @types/zen-observable.

So I'm doing the following hack while they push the zen-observable fix

"hack": "pushd node_modules/@types/zen-observable && sed -i 's/observable: symbol/readonly observable: symbol/' index.d.ts && popd"

I use that on my CI/CD after npm install

On OSX it's sed -i '' 's/observable: symbol/readonly observable: symbol/' index.d.ts

More Issues: