Skip to content

Polyfill ES6 Symbol #4676

Closed
Closed

Description

@atom992

Hi, my env:
react-native-cli : 0.1.7
react-native : 0.16.0
react-native-icons: 0.7.0

when I run my app ,I got the following error:

E/ReactNativeJS( 2973): Can't find variable: Symbol

but the Example of react-native-icons works fine.

Activity

  1. facebook-github-bot commented on Dec 9, 2015

    @facebook-github-bot
    Contributor

    Hey atom992, thanks for reporting this issue!

    React Native, as you've probably heard, is getting really popular and truth is we're getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly.

    • If this is a feature request or a bug that you would like to be fixed by the team, please report it on Product Pains. It has a ranking feature that lets us focus on the most important issues the community is experiencing.
    • If you don't know how to do something or not sure whether some behavior is expected or a bug, please ask on StackOverflow with the tag react-native or for more real time interactions, ask on Discord in the #react-native channel.
    • We welcome clear issues and PRs that are ready for in-depth discussion; thank you for your contributions!
  2. satya164 commented on Dec 9, 2015

    @satya164
    Contributor

    @atom992 Probably you've some code using ES2015 Symbols? Can you share your code?

  3. DanielHoffmann commented on Dec 9, 2015

    @DanielHoffmann

    @atom992 you are probably having the same problem as me in #4587 try removing all instances of for of in your code.

  4. skevy commented on Dec 12, 2015

    @skevy
    Contributor

    @atom992 @DanielHoffmann I actually just ran into this issue on iOS 8. I personally just used the babel-polyfill (http://babeljs.io/docs/usage/polyfill/) to fix it...there are other Symbol polyfills that may be smaller (since babel-polyfill polyfills lots of things). Use at your discretion and let us know if it fixes it!

  5. vjeux commented on Dec 17, 2015

    @vjeux
    Contributor

    Our goal with React Native is to provide a consistent js environment across all the platforms. We should polyfill it. @skevy want to take on this task?

    TaskRabbit also hit this issue because IOS 9 has Symbol but not IOS 7 and 8: http://tech.taskrabbit.com/blog/2015/12/17/react-native-launch/

  6. changed the title [-][Android] Can't find variable: Symbol[/-] [+]Polyfill Symbol[/+] on Dec 17, 2015
  7. changed the title [-]Polyfill Symbol[/-] [+]Polyfill ES6 Symbol[/+] on Dec 17, 2015
  8. self-assigned this
    on Dec 17, 2015
  9. atom992 commented on Jan 5, 2016

    @atom992
    Author

    any update?

  10. satya164 commented on Jan 5, 2016

    @satya164
    Contributor

    ping @skevy

  11. skevy commented on Jan 5, 2016

    @skevy
    Contributor

    So, I'm sure I can bring in a symbol polyfill easy enough...but does anyone know of anything else that should be polyfilled on anything less than ios 8?

  12. atom992 commented on Jan 6, 2016

    @atom992
    Author

    I am running on android 5.0.1 emulator, when I run as "debug in chrome",this error will not show,but when I run on real device, when ever I run as "debug in chrome" or not, I always show the error.

  13. atom992 commented on Jan 9, 2016

    @atom992
    Author

    when I run my real device(with ./gradlew installRelease) I got the following error:

    I/ReactNativeJS(31911): Running application "Myapp" with appParams: {"initialProps":{},"rootTag":1}. __DEV__ === false, development-level warning are OFF, performance optimizations are ON
    E/ReactNativeJS(31911): Can't find variable: Symbol
    
  14. 7 remaining items

  15. babbarankit commented on Mar 3, 2016

    @babbarankit

    @ide How Do I use this plugin?
    I need it urgently. Thanks.

  16. ide commented on Mar 3, 2016

    @ide
    Contributor

    @babbarankit it's not super simple if you're not familiar with babel... if this is time-sensitive for you, I recommend hiring a consultant who can help you for this one task

  17. mkonicek commented on Jul 29, 2016

    @mkonicek
    Contributor

    Hi there! This issue is being closed because it has been inactive for a while.

    But don't worry, it will live on with ProductPains! Check out its new home: https://productpains.com/post/react-native/polyfill-es6-symbol

    ProductPains helps the community prioritize the most important issues thanks to its voting feature.
    It is easy to use - just login with GitHub. GitHub issues have voting too, nevertheless
    Product Pains has been very useful in highlighting the top bugs and feature requests:
    https://productpains.com/product/react-native?tab=top

    Also, if this issue is a bug, please consider sending a pull request with a fix.
    We're a small team and rely on the community for bug fixes of issues that don't affect fb apps.

  18. afilp commented on Aug 1, 2016

    @afilp

    Hello, this is closed, but is it fixed somehow? Our app fails because we are using the ES2015 "for of" construct.

  19. maluramichael commented on Sep 2, 2016

    @maluramichael

    Same here. Our Application crashes on Android because of the for ... of loops.

  20. jacobp100 commented on Dec 13, 2016

    @jacobp100
    Contributor

    Just import 'core-js' on Android.

  21. linonetwo commented on Jan 8, 2017

    @linonetwo

    Why not just automatically import 'core-js' for every Android project?

  22. satya164 commented on Jan 8, 2017

    @satya164
    Contributor

    @linonetwo core-js has a lot of things and it'll slow down the initial load since we've to parse the extra unnecessary stuff now. You should manually import only the things you need from core-js

  23. joncursi commented on Oct 29, 2017

    @joncursi
    Contributor

    The following worked for me:

    // index.android.js
    import 'core-js/es6/symbol';
    import 'core-js/fn/symbol/iterator';

    However, this unfortunately caused other issues with other parts of my app.

  24. jeslabs commented on Dec 19, 2017

    @jeslabs

    @joncursi by adding this polyfill, the BackHandler subscription works again for me:
    import "core-js/es6/set";

  25. locked as resolved and limited conversation to collaborators on Jul 20, 2018
  26. added
    Resolution: Locked
    on Jul 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

JavaScriptResolution: Locked

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions