Skip to content

internal/types.d.ts(38,13): Property 'observable' does not exist on type 'SymbolConstructor'. #3674

Closed

Description

@phra

after upgrading my angular app to latest version (including rxjs v6) i got the following error at compile time:

../node_modules/rxjs/internal/types.d.ts(38,13): error TS2339: Property 'observable' does not exist on type 'SymbolConstructor'.

RxJS version:

    "rxjs": "^6.1.0",
    "rxjs-compat": "^6.1.0",

Expected behavior:
it works.

Actual behavior:
it breaks the compilation.

Additional information:
involved declaration:

export declare type InteropObservable<T> = {
    [Symbol.observable]: () => Subscribable<T>;
};

adding rxjs-compat doesn't solve the issue.

Activity

  1. benlesh commented on May 21, 2018

    @benlesh
    Member

    Do you have a minimal reproduction?

  2. phra commented on May 25, 2018

    @phra
    Author

    @benlesh i've debugged the issue and it was related to nodejs typings.. i have fixed them in order to make the compilation work again.

    see DefinitelyTyped/DefinitelyTyped#26034

  3. benlesh commented on May 26, 2018

    @benlesh
    Member

    Awesome, thanks @phra!

  4. localyost3000 commented on Jun 6, 2018

    @localyost3000

    Upgrading to the latest node-typings to get @phra's change introducing a new error:

    ERROR in node_modules/rxjs/internal/symbol/observable.d.ts(4,9): error TS2687: All declarations of 'observable' must have identical modifiers.
    node_modules/@types/node/index.d.ts(167,14): error TS2687: All declarations of 'observable' must have identical modifiers.
    
  5. phra commented on Jun 7, 2018

    @phra
    Author

    @swimmadude66 i was not having that problem. it seems like that one of your imported type declaration it's re-declaring observable, declare in @types/node. can you debug your node_modules directory to find if there are multiple declarations of observable?

  6. localyost3000 commented on Jun 7, 2018

    @localyost3000

    @phra my only types are @types/node, and a search for the string observable in node_modules/**/*.d.ts only finds those, rxjs, and angular/http. I'm not sure what changed that this log appeared in my build in the first place, but updating types/node makes the worse error

  7. phra commented on Jun 8, 2018

    @phra
    Author

    @swimmadude66 is maybe some angular/http recent version that was released later ? it can be that they tried to fix the issue on their side since they are heavily using observables in that module. at the moment i don't have time to debug since i don't have the issue.. what do you think about posting a repro code?

  8. localyost3000 commented on Jun 8, 2018

    @localyost3000

    @phra I just did some digging and I think I figured it out. your fix for node typings added observable to symbol, but added it as readonly. The latest release of rxjs (6.2.0 at the time of this writing) has Symbol.observable declared without readonly causing the error I posted.

    It appears that the readonly flag was added to Symbol.observable in e1c203f 7 days ago, but a release has yet to be drafted from master since. So I am going to just downgrade my node typings again and live with the warning until rxjs 6.2.1, at which point it appears it will be safe to include your fix.

    @benlesh could I get an idea of a timeline on an upcoming patch to roll out this fix please?

  9. phra commented on Jun 8, 2018

    @phra
    Author

    @swimmadude66 thanks for debugging it! 🎉 🎉

    having the readonly modifier is for sure a good thing!

  10. localyost3000 commented on Jun 8, 2018

    @localyost3000

    for sure, thank you for actually pushing the fix!

  11. locked as resolved and limited conversation to collaborators on Jul 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions