Skip to content

[Bug] 3.28.x - Error while hide input field on IE11 (Unhandled promise rejection Error: Invalid argument) #20347

@mkszepp

Description

@mkszepp

🐞 Describe the Bug

When i hide a input field (checkbox...) i get the error Unhandled promise rejection Error: Invalid argument.
This error occures, when i add ember-cli-babel: { includePolyfill: true } in ember-cli-build.js (https://github.com/mkszepp/promise-bug-ie11/blob/82f5bf3c045a4dfc72eddf5a227158c80dfa55c9/ember-cli-build.js#L7-L9)

It looks like a polyfill (Symbol iterator) is not compatible with this code part (Line 193, because code 182 - 192 will be skipped in IE11 and modern browsers):

export function createForOfIteratorHelperLoose(o) {
let i = 0;
if (typeof Symbol === 'undefined' || o[Symbol.iterator] == null) {
// Fallback for engines without symbol support
if (Array.isArray(o) || (o = unsupportedIterableToArray(o)))
return function () {
if (i >= o.length) return { done: true };
return { done: false, value: o[i++] };
};
throw new TypeError(
'Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'
);
}
i = o[Symbol.iterator]();
return i.next.bind(i);
}

The error occures also only, when jquery is completly removed/disabled in optional feature.

🔬 Minimal Reproduction

  1. Clone the repo https://github.com/mkszepp/promise-bug-ie11 or download build.zip and go to step 4
  2. Install packages
  3. ember build --environment=production
  4. Open build in IE11
  5. Click on "Toggle input" button
  6. Error Unhandled promise rejection Error: Ungültiges Argument

grafik

🌍 Environment

  • Ember: 3.28.11
  • Node.js/npm: 14.18.3
  • OS: Windows 10
  • Browser: Internet Explorer 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions