useProxies: 'never' still throws error on IE11 #2607
-
To make MobX 6 work in IE11 I have added the following code at the beginning of my index.tsx:
Intended outcome: The app should work in IE11 without any Proxy errors from Mobx. Actual outcome: I get the following error from mobx:
How to reproduce the issue: Tried creating a reproducible app in CodeSandbox but it won't run at all in IE11 :( I did some debugging and it seems that mobx runs the following code before mobx/packages/mobx/src/api/observable.ts Line 157 in 50b4eb5 This means that if you have an observable array in your app mobx will try to create it using Versions
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
This means you are not calling |
Beta Was this translation helpful? Give feedback.
-
You’re absolutely right, My store containing observables was initialized when imported which caused the code to run before configure. I refactored my store to be initialized later and now it works! Thanks a lot for pointing me in the right direction and sorry for creating a false bug report! 🙂 |
Beta Was this translation helpful? Give feedback.
-
We've called |
Beta Was this translation helpful? Give feedback.
This means you are not calling
configure
soon enough. Note thatimport
statements of observable using modules will already execute the module body, so you might need to reorder your configure and import statements a bit more, or make sure that your top level statements don't initialize observables yet.The stack trace should reveal where you are trying to create an observable array .