Current Behavior
A clear and concise description of the behavior.
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.
Reproduction
After installing rxjs 6.2.0 and rxjs-compat 6.2.0, navigate to
'/node_modules/rxjs/internal/symbol/observable.d.ts'
and
'./node_modules/\@types/node/index.d.ts'
The IDE will indicate the error line
readonly observable: symbol;
[ts] All declarations of 'observable' must have identical modifiers.
(property) SymbolConstructor.observable: symbol
Expected behavior
The source code has error when using IDE to inspect.
The error should not appear.
Environment
Additional context/Screenshots
Add any other context about the problem here. If applicable, add screenshots to help explain.
https://imgur.com/a/eMdeN6k
Dupe of #3697?
Looks likely by reading error message.
@types/node uses the readonly modifier:
interface SymbolConstructor {
readonly observable: symbol;
readonly iterator: symbol;
readonly asyncIterator: symbol;
}
as does symbol-observable:
declare global {
export interface SymbolConstructor {
readonly observable: symbol;
}
}
The declaration in master does not. but once #3773 is merged, all of the declarations should be compatible.
got this error. how to workaround until release please?
@andreimcristof fallback your types/node version
@vincent-cm thanks, it worked. cheers
this has been fixed in 6.2.1 https://www.npmjs.com/package/rxjs/v/6.2.1
Confirmed. 6.2.1 working for me.
The problem is still present with latest versions:
"rxjs": "6.2.1",
"@types/node": "10.3.6"
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(169,14): error TS2687: All declarations of 'observable' must have identical modifiers.
@adappter The declaration is readonly observable: symbol; in @types/node version 10.5.1 and is the same in rxjs 6.2.1.
You might want to update to the latest @types/node declarations and might also want to ensure that you have only one installation of rxjs in your node_modules - to do so, run npm list rxjs.
this is the output of npm list rxjs:
@angular-devkit/[email protected]
โ โโโฌ @angular-devkit/[email protected]
โ โ โโโ [email protected] deduped
โ โโโ [email protected] deduped
โโโฌ @angular-devkit/[email protected]
โ โโโ [email protected] deduped
โโโฌ @angular/[email protected]
โ โโโฌ @angular-devkit/[email protected]
โ โ โโโ [email protected] deduped
โ โโโฌ @schematics/[email protected]
โ โ โโโ [email protected] deduped
โ โโโ [email protected] deduped
โโโ [email protected]
I installed the latest @types/nodes 10.5.1. I can also see the same declarations in both files. But I still get the error. Also after reinstalled node modules
@adappter You should be able to verify, yourself, that the @types/node and rxjs declarations for observable symbol match. If they do, then your issue differs from this one. Perhaps there is another declaration of observable symbol somewhere in your code base?
In any case, if the two declarations are the same, you should open another issue instead of commenting on this issue - which is closed. As a general rule, it's better to create a new issue rather than comment on one that's closed. Just reference the closed issue from the newly opened one, if you suspect they are related.
Alright I'll have a look at will open a new issue if necessary
Most helpful comment
this has been fixed in 6.2.1 https://www.npmjs.com/package/rxjs/v/6.2.1