Mobx-state-tree: TypeScript error: Type instantiation is excessively deep and possibly infinite. TS2589

Created on 4 Apr 2019  路  3Comments  路  Source: mobxjs/mobx-state-tree

_Bug report_

  • [x] I've checked documentation and searched for existing issues
  • [x] I've made sure my project is based on the latest MST version
  • [x] Fork this code sandbox or another minimal reproduction.

Sandbox link or minimal reproduction code

https://github.com/benkuly/mst-issue-ts2589

Describe the expected behavior

I defined the mst-model in a seperate/shared project (in the example it is named "common").
Now I want to use it in another project (in the example it is named "client").

This already works, if I define the mst-model in the same project.

Describe the observed behavior

The "common" project compiles without errors, but I get TypeScript error: Type instantiation is excessively deep and possibly infinite. TS2589 when I want to compile the "client" project.
It seems to be related with the generated declaration files in the "common" project

Thanks for your help!

Typescript bug has PR

Most helpful comment

Should be fixed in v3.14.0

All 3 comments

Should be fixed in v3.14.0

Very cool! Thank you! :-)

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

raymondsze picture raymondsze  路  4Comments

lishine picture lishine  路  4Comments

xgenvn picture xgenvn  路  3Comments

ShootingStarr picture ShootingStarr  路  4Comments

marszhou picture marszhou  路  3Comments