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

Hello,

I’m using 6to5ify with Browserify to get modules working properly with the following task:

gulp.task('scripts', function() {
  return gulp.src("js/main.js")
    .pipe(browserify({
        transform: [to5ify]
    }))
    .pipe(gulp.dest('./dist'));
});

This works just fine, but it throws the error ReferenceError: Can't find variable: Symbol, caused by this conversion:

for (let myObject of myArray) {
  // ...
}

becomes:

for (var _iterator = myArray[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) {
  var object = _step.value;
  // ...
}

Symbol is defined nowhere. Should I just avoid using the for-of-loop?

Greetings Arne Bahlo

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

11reactions
thanatoscommented, Jan 27, 2017

Since Babel only transforms syntax

This is misleading, IMO; from the POV of the user, all I’m doing is a syntax transformation (for of). Yet I end up requiring babel-polyfill anyways.

4reactions
JoshCheekcommented, Jan 5, 2016

@kittens neither of the links resolve for me. I was able to get a page by swapping “6to5.org” with “babeljs.io” (https://babeljs.io/docs/faq/) but it is very sparse so its unclear what is wrong and what to do about it.

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

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