Skip to content
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

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

Closed
phra opened this issue May 9, 2018 · 10 comments

Comments

@phra
Copy link

phra commented May 9, 2018

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.

@benlesh
Copy link
Member

benlesh commented May 21, 2018

Do you have a minimal reproduction?

@phra
Copy link
Author

phra commented May 25, 2018

@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

@benlesh
Copy link
Member

benlesh commented May 26, 2018

Awesome, thanks @phra!

@benlesh benlesh closed this as completed May 26, 2018
@swimmadude66
Copy link

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.

@phra
Copy link
Author

phra commented Jun 7, 2018

@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?

@swimmadude66
Copy link

@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

@phra
Copy link
Author

phra commented Jun 8, 2018

@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?

@swimmadude66
Copy link

swimmadude66 commented Jun 8, 2018

@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?

@phra
Copy link
Author

phra commented Jun 8, 2018

@swimmadude66 thanks for debugging it! 🎉 🎉

having the readonly modifier is for sure a good thing!

@swimmadude66
Copy link

for sure, thank you for actually pushing the fix!

@lock lock bot locked as resolved and limited conversation to collaborators Jul 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants