You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The compilation error we get from TypeScript when trying to compile is the following:
error TS2339: Property 'id' does not exist on type 'ObservableSet<any>'.
myObservable.id = 'newId'
If we take a closer look at the issue, we can see that TypeScript infers that myObservable is typeof ObservableSet when it should be simply the type of the parameter pass to observable.
I can have a look to try to fix the issue on mobx side, the only condition is too being able to upgrade the TypeScript version up to 3.6.4
The text was updated successfully, but these errors were encountered:
The issue seems due to the fact that I was missing the lib es2016 in my tsconfig causing the TypeScript engine to consider the Set type as an object type. Closing for now. Maybe it may require to add some information when building a new project.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or questions.
lockbot
locked as resolved and limited conversation to collaborators
Dec 24, 2019
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I have a:
Hi,
I'm working with MobX and TypeScript and I notice that TypeScript incorrectly infers types from observable.
TypeScript version : 3.6.4 (LKG)
The compilation error we get from TypeScript when trying to compile is the following:
If we take a closer look at the issue, we can see that TypeScript infers that myObservable is typeof ObservableSet when it should be simply the type of the parameter pass to
observable
.I can have a look to try to fix the issue on mobx side, the only condition is too being able to upgrade the TypeScript version up to 3.6.4
The text was updated successfully, but these errors were encountered: