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 #50

Closed
andon opened this issue Jul 13, 2017 · 2 comments
Closed

Can't find variable: Symbol #50

andon opened this issue Jul 13, 2017 · 2 comments
Assignees

Comments

@andon
Copy link
Member

andon commented Jul 13, 2017

screen shot 2017-07-13 at 14 45 53

If you ran the project on iOS 8, and most of the Android OSs (tested on Android 7.0), you will run into this issue.

This is due to the fact, that Symbol is not supported with the JavaScriptCore that comes with those OSs. This was not fixed in the react-native to be properly polyfilled for all supported platforms (iOS 8 and above, Android 4.1 and above as stated in RN README.md).

Solution should be to include either the babel-polyfill or parts of core-js in the root of the application files (index.ios.js, index.android.js):

import 'babel-polyfill'
// or
import 'core-js/modules/es6.symbol';

Shell we document this requirement?

Is there a eslint rule that might catch usage of those, so that we can check them?

Example, for Android, in one project we needed to also import some of the core data structure, having the following at the top of index.android.js:

import 'core-js/modules/es6.symbol';
import 'core-js/modules/es6.set';
import 'core-js/modules/es6.map';
import 'core-js/modules/es6.weak-map';
import 'core-js/modules/es6.weak-set';
@andon
Copy link
Member Author

andon commented Jul 13, 2017

Related: facebook/react-native#4676

@ognen
Copy link
Member

ognen commented Sep 13, 2017

Changed the use of Symbols to namespaced property names in #60

@ognen ognen closed this as completed Sep 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants