xaviergonz / mobx-keystone

A MobX powered state management solution based on data trees with first class support for Typescript, support for snapshots, patches and much more
https://mobx-keystone.js.org
MIT License
554 stars 25 forks source link

Package issues with metro bundler / react-native #263

Closed andriimuzh closed 3 years ago

andriimuzh commented 3 years ago

I'm trying to setup a new project with React Native v. 0.64.1 and typescript 3.8.3. Installation of mobx-keystone using npm or yarn is going well but I'm facing a warning when trying to start a Metro Bundler using npx react-native start command and receive a warning in console:

warn Package mobx-keystone has been ignored because it contains invalid configuration. Reason: Package subpath './package.json' is not defined by "exports" in /Users/andrii/projects/tsApp/node_modules/mobx-keystone/package.json

xaviergonz commented 3 years ago

is there a chance you might publish a repo with this error?

andriimuzh commented 3 years ago

yes I can publish it if you want, but you can easily reproduce it just by initing a new React Native project and installing mobx-keystone. so steps to reproduce it's just: 1) npx react-native init AwesomeTSProject --template react-native-template-typescript 2) npm i mobx-keystone or using yarn if you want 3) npx react-native start 4) see the warning in console

Also I did some research and noticed that I can' face warning using mobx-keystone 0.55.0, this warning seems to become visible only in newest versions

Thank you

xaviergonz commented 3 years ago

I couldn't get it to fail (at least not without connecting a phone), but I published a tentative fix in 0.60.1, let me know if it works...

andriimuzh commented 3 years ago

Yes, the issue is resolved in the new 0.60.2 version. Thanks a lot for the help

xaviergonz commented 3 years ago

you are welcome!