hermes: Problem with MobX 5+ : Your environment doesn't support Symbol and Proxy objects.

Problem: MobX 5+ requires Proxy and Symbol objects. If your environment doesn’t support Symbol or Proxy objects, please downgrade to MobX 4. For React Native Android, consider upgrading JSCore., js engine: hermes

IMAGE 2019-07-12 14:50:25

Reproducing the error:

react-native init HermesWithMobX
yarn add mobx --save
yarn add mobx-react-lite
project.ext.react = [
    entryFile: "index.js",
    enableHermes: true, 
]

And I’m just using the MobX also you can look this repo for this example:

Example Repo: https://github.com/talut/mobx-with-hermes-example

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 19
  • Comments: 19 (5 by maintainers)

Commits related to this issue

Most upvoted comments

A lot of people (including me) are using mobx and mst, so this is really sad Hermes excluded proxy from the support list.

Does anyone know what specific features MobX requires Proxy for?

For object dynamic properties observing and for wrapping arrays. MobX@4 arrays could not work properly with some third-party libraries.

we could submit a PR to avoid that check until it’s necessary

This PR will not be accepted. Using Proxy’es was deliberate decision. MobX@4 is official LTS for old js environments. In most cases downgrading to MobX@4 is ok.

But IMO Proxy should be supported in long-term.

See the most recent updates on issue https://github.com/facebook/hermes/issues/33#issuecomment-606963341

Proxy is now enabled in Hermes, but not yet by default. See the instructions in that comment for enabling it and testing it out. Once we’re more certain that there aren’t bugs in the Proxy implementation we’ll expose it by default.

We are investigating Proxy for Hermes, so that will be a solution at some point. I’m not ready to give a date, but progress is looking good. https://github.com/facebook/hermes/issues/33#issuecomment-523624024

@talut you can check this doc.its excluded. https://github.com/facebook/hermes/blob/master/doc/Features.md#excluded-from-support

Thanks for answer, I think thats a bad news. Fortunately I’m just using MobX for only experimental reasons. For real projects, my main structure built with Redux.

That’s a bummer… Using Proxy makes me feel so smart! 🤓

Downgrading to MobX 4 has been rather painful for me what with the caveats listed here: https://mobx.js.org/best/pitfalls.html