Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can’t find variable: Symbol #15786

Closed
sm2017 opened this issue Sep 4, 2017 · 12 comments
Closed

Can’t find variable: Symbol #15786

sm2017 opened this issue Sep 4, 2017 · 12 comments
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@sm2017
Copy link
Contributor

sm2017 commented Sep 4, 2017

"Debug JS Remotely" is very buggy system , I have many issue with it

I use Symbol in a js file from 6 months ago , Today react-native told me

Can’t find variable: Symbol

Cannot find what?! Why you could find it yesterday?!

After hours of hard working and searching, I found that my codes works on iOS , but don't works in my and other machine (So there is no cache issue) that run-android

Suddenly I see https://medium.com/@jordan_mohi/cant-find-variable-symbol-in-react-native-782489d86bd7

OH!!! MY GOD!!!!! Debug JS Remotely !!! 😡

See also #15497 (I don't know why no body care it)

I open dev menu and press Debug JS Remotly , my code works

React Can find Symbol 😮 😲 😵 😳

@radko93
Copy link
Contributor

radko93 commented Sep 4, 2017

@facebook-github-bot no-template

@facebook-github-bot
Copy link
Contributor

Hey, thanks for reporting this issue! It looks like your description is missing some necessary information, or the list of reproduction steps is not complete. Can you please add all the details specified in the Issue Template? This is necessary for people to be able to understand and reproduce the issue being reported. I am going to close this, but feel free to open a new issue with the additional information provided. Thanks! See "What to Expect from Maintainers" to learn more.

@facebook-github-bot facebook-github-bot added the Ran Commands One of our bots successfully processed a command. label Sep 4, 2017
@sm2017
Copy link
Contributor Author

sm2017 commented Sep 5, 2017

💩💩💩💩💩💩💩

#15497 has template

@sm2017
Copy link
Contributor Author

sm2017 commented Sep 5, 2017

I open #15805

@rottenoats
Copy link

Was getting the same error when using mobx for android.

Solution:
https://github.com/react-community/jsc-android-buildscripts#how-to-use-it-with-my-react-native-app

@Tai13492
Copy link

Tai13492 commented Jul 5, 2018

You should try
npm install --save es6-symbol
Then,
import 'es6-symbol/implement';
At the starting point of your project (App.js/index.js).
This will solve your problem but it may lead you to another problem if you are using mobx in your project.
The way to solve it is to downgrade your mobx version to 4.x.x (mobx version >= 5 will crash)
Hope this helps.

@badarshahzad
Copy link

Does their exist any other solution?

@newyankeecodeshop
Copy link
Contributor

Using the upgraded jsc-android is your bet because it has the same runtime support as iOS 10+. You'll get a more consistent runtime experience.

@badarshahzad
Copy link

Where this could be find?

@newyankeecodeshop
Copy link
Contributor

@badarshahzad Instructions are here: https://github.com/react-community/jsc-android-buildscripts#how-to-use-it-with-my-react-native-app
If you don't want to bump the minSdkVersion to 21 for that version of JSC (it includes 64-bit support), then you can use [email protected]. We've been using that version in two production apps targeting Android 17+ and it has been flawless.

@badarshahzad
Copy link

Thank you to suggest this one but I face this error when I used MobX instead of Redux. I am junior so kindly enlighten me what to do now.

@stevefan1999-personal
Copy link

stevefan1999-personal commented Jul 27, 2018

Try this, it is very simple:

  1. Install babel-polyfill and proxy-polyfill
  2. Import them at the highest level
  3. ???
  4. Profit!

You could use babel-plugin-transform-runtime if you wanted, but a proper polyfill is still recommended, and if you don't like babel-polyfill you could always try alternatives like core-js. Sadly babel-preset-env cannot detect react-native and if they do so the polyfill cherrypicking process can be simplified and can reuse many builtins...

Proxy cannot be polyfilled by babel-polyfill, so do keep in mind that proxy-polyfill can be non-compliant, even if it is backed by Google.

@facebook facebook locked as resolved and limited conversation to collaborators Sep 4, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Sep 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

9 participants