mobxjs / mobx-react

React bindings for MobX
https://mobx.js.org/react-integration.html
MIT License
4.85k stars 350 forks source link

Incosistencies in mobx-react dependency versions. #913

Closed ssejjemba closed 4 years ago

ssejjemba commented 4 years ago

We have a setup of a react app that has been building fine with the following combinations of mobx libraries.

"mobx": "5.15.4",
"mobx-react": "6.2.5",

Then we bumped the mobx-react version to 6.3.0 to have the new combination as

"mobx": "5.15.4",
"mobx-react": "6.3.0",

And this also built fine without errors for a while, until it started failing with the following error:

./node_modules/mobx-react-lite/es/utils/assertEnvironment.js
Attempted import error: 'makeObservable' is not exported from 'mobx'.

It is important to note that we are not using mobx-react-lite in our repository, regardless when we tried to switch back to the original combination it still failed with the same error. Also on the CI running the build again with the same exact inputs that worked a couple of weeks ago, nothing changed now also fails with exactly the same error as above. Changing the version to mobx-react: 6.3.1 solves the build and no more errors with this version. But doesn’t tell us exactly why the same code with the same inputs would pass at a certain point and then fail at another.

mweststrate commented 4 years ago

See https://github.com/mobxjs/mobx-react-lite/issues/319. There is no point in reporting issues on old versions that as you indicate have been already fixed in newer versions.

But doesn’t tell us exactly why the same code with the same inputs would pass at a certain point and then fail at another.

Sounds like your package / yarn lock files are either different since them, or you are not using them and you should :). Installs are only deterministic if you use those, and actual installed versions of a package isn't determined by your package.json but by your lock files.