mobx icon indicating copy to clipboard operation
mobx copied to clipboard

Not working at IE11 with latest MobX 6

Open Dev-Taehui opened this issue 1 year ago • 6 comments

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

Dev-Taehui avatar Oct 11 '23 09:10 Dev-Taehui

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)

mweststrate avatar Oct 11 '23 19:10 mweststrate

@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

Dev-Taehui avatar Oct 12 '23 01:10 Dev-Taehui

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: @.***>

mweststrate avatar Oct 12 '23 05:10 mweststrate

@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 avatar Oct 12 '23 07:10 Dev-Taehui

@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.

Dev-Taehui avatar Oct 12 '23 08:10 Dev-Taehui

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

mweststrate avatar Oct 12 '23 14:10 mweststrate