mobxjs / mobx

Simple, scalable state management.
http://mobx.js.org
MIT License
27.52k stars 1.77k forks source link

Not working at IE11 with latest MobX 6 #3771

Open Dev-Taehui opened 1 year ago

Dev-Taehui commented 1 year ago

Intended outcome: Working at IE11

Actual outcome: Not working at IE11 and throws exception (@@toPrimitive must return a primitive value.)

How to reproduce the issue: I created very simple and minimal reproducible github project (https://github.com/Dev-Taehui/ie11test). Clone it, npm install, and npm run local for build and serve to local test.

Versions MobX 6.10.2 React 17.0.2 React-Scripts 4.0.3 Node.js 18.17.1 IE 11

mweststrate commented 1 year ago

What is the latest version that does work, to be able to intersect a potential cause? (I don't have IE11 at my disposal here)

Dev-Taehui commented 1 year ago

@mweststrate I tried MobX 6.3.3, MobX 6.0.0. But it doesn't work with same reason.

I tested IE11 with VBS script on Windows 11. Create Launch IE.vbs file and write this command to it.

CreateObject("InternetExplorer.Application").Visible = true

Then, run it

mweststrate commented 1 year ago

I don't have Windows neither 🙂. But if older versions don't work as well, ot might also be something else in your stack. Like the build tooling. What made you conclude it is MobX? Do you have a stack for the error? Are the React and create-react-app version etc IE 11 compatible?

On Thu, 12 Oct 2023, 03:58 Dev Taehui, @.***> wrote:

@mweststrate https://github.com/mweststrate I tried MobX 6.3.3, MobX 6.0.0. But it doesn't work with same reason.

I tested IE11 with VBS script. Create Launch IE.vbs file and write this command to it.

CreateObject("InternetExplorer.Application").Visible = true

Then, run it

— Reply to this email directly, view it on GitHub https://github.com/mobxjs/mobx/issues/3771#issuecomment-1758793555, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN4NBEL7MUYASXOFTVG623X65FEPANCNFSM6AAAAAA53WVZGA . You are receiving this because you were mentioned.Message ID: @.***>

Dev-Taehui commented 1 year ago

@mweststrate According to the example I posted, calling mobx's configure({ useProxies: "never" }) in index.js does not work in IE11. If I remove that code it works on IE11

And, I create Next.js 12 and React 17 project. It has same error when I call configure({ useProxies: "never" }).

Dev-Taehui commented 1 year ago

@mweststrate Does need other polyfills for CRA project? Accroding to thrown error, It seems to be that @@toPrimitive Symbol and decorator was not fully polyfilled.

mweststrate commented 1 year ago

Yeah you will need some Symbol polyfills: https://github.com/zloirock/core-js#ecmascript-symbol.