Issue #864Opened February 13, 2018by panagulis720 reactions

Symbol.iterator in Internet Explorer doesn't work

Question

When I add an Image, in this block:

  for (var _iterator = files[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
    var file = _step.value;

    _loop(file);
  }`

I get the error:

the object does not support the property or the 'jscomp_symbol_iterator0' method

It happens on IE 11. Is there an alternative to write that loop in another way, supported by IE?

Answers (3)

ryandebaFebruary 14, 20180 reactions

Hi @panagulis72,

Have you looked into using a polyfill? A quick google search found this...I've never used Symbol.iterator before, so that's probably as much as I'd be able to help :(

artfFebruary 18, 20180 reactions

Hi @panagulis72, unfortunately, that piece of code is generated by the compiler from this method (is it intentional your use of embedAsBase64?) if you want to find a way to write it up without generating it I'd be glad to merge your PR

panagulis72February 18, 20180 reactions

Hi @artf ! I'm talking about this file: https://raw.githubusercontent.com/artf/grapesjs/dev/dist/grapes.js

Code SnippetTEXT
try to search the string:

` for (var _iterator = files[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)`

I'm talking about this loop

But I solved this issue replacing with this code:

`    try {
      for(var i = 0; i < files.length; i++){
        var file = files[i];
        _loop(file);
      }
    } catch (err) {
      _didIteratorError = true;
      _iteratorError = err;
    } finally {
      if (_didIteratorError) {
        throw _iteratorError;
      }
    }`


I don't know if it is a good solution, but in Internet Explorer works fine

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.