Robert
Robert

Reputation: 1

Angular Mobx multiple versions

In my angular project, I have multiple dependencies which require mobx.

There is mobx-react which requires v. 6.1.0 as a peer dependency

@circlon/angular-tree-component requires 4.14.1

This causes an error in the console: " [mobx] There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use configure({ isolateGlobalState: true }) "

The docs for mobx are unclear where to run the configure function to avoid this error. https://mobx.js.org/configuration.html

Upvotes: 0

Views: 623

Answers (1)

5jasonc
5jasonc

Reputation: 3

I would avoid using the mobX configuration to isolate the global state, as this can cause problems if parts of your program are trying to interact with each other with different mobX versions. Just go to package-lock.json and change the dependency version for the angular-tree-component to the version you have as a dependency elsewhere, then run npm install.

Upvotes: 0

Related Questions