Can't find variable: Symbol
See original GitHub issueEnvironment
OS: Linux 4.13 Node: 8.1.4 Yarn: 1.0.1 npm: 4.6.1 Watchman: 4.9.0 Xcode: N/A Android Studio: Not Found
Packages: (wanted => installed) expo: ^25.0.0 => 25.0.0 react: 16.2.0 => 16.2.0 react-native: https://github.com/expo/react-native/archive/sdk-25.0.0.tar.gz => 0.52.0
Diagnostics report: https://exp-xde-diagnostics.s3.amazonaws.com/hunsuexp-1c483c6f-406e-48b1-bf55-570171e5418d.tar.gz
Steps to Reproduce
I’m using the module https://github.com/WhatAKitty/react-native-fetch-mock/i and I got the error ‘Can’t find variable: Symbol’. Normally Symbol works with expo according tohttps://docs.expo.io/versions/latest/guides/using-modern-javascript.html
It was fixed when I added babel-polyfill but then I got warnings:
Warning: Failed prop type: Invalid prop children
of type object
supplied to Provider
, expected a single ReactElement.
Expected Behavior
Symbol works with Expo
Actual Behavior
Reproducible Demo
Here is reproduction repo https://github.com/Hunsu/react-native-fetch-mock-issue-5 on commit b43934e08e98f64ad5e2b7fe3cfc85408e726ab2
After yarn install you will get the error about the Symbol.
On the last commit you will get the error about the props.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:12 (4 by maintainers)
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.
It also happens with other libraries and my own components. I did tried to add the console.log statements but the app crashes. I will try to debug the issue.