question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't find variable: Symbol

See original GitHub issue

Environment

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

screenshot from 2018-02-02 19-46-21 screenshot from 2018-02-02 19-45-59

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:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
Tai13492commented, 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.

1reaction
Hunsucommented, Feb 6, 2018

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't find variable: Symbol · Issue #15786 - GitHub
"Debug JS Remotely" is very buggy system , I have many issue with it I use Symbol in a js file from 6...
Read more >
React Native - Cant find variable: Symbol - Stack Overflow
I am writing an React-Native-Web (RNW) app. The basic design is a core application that takes a library of custom React-Native components as...
Read more >
How to Resolve The Cannot Find Symbol Error in Java - Rollbar
When the Java compiler encounters a use of an identifier which it cannot find in the symbol table, it raises the cannot find...
Read more >
Compiling ECS 6 for Safari - polyfill - Can't find Symbol
It works just fine but in safari everything is broken because of: Error: ReferenceError: Can't find variable: Symbol I search my ways and...
Read more >
What can cause the "cannot find symbol" error in Java?
The “cannot find symbol” error occurs mainly when we try to reference a variable that is not declared in the program which we...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found