autosuggest-highlight icon indicating copy to clipboard operation
autosuggest-highlight copied to clipboard

Version 3.3.0 breaks IE11

Open Richacinas opened this issue 2 years ago • 7 comments

I have done my research and found out that the latest version of this library (v3.3.0) is breaking Internet Explorer.

In our case, IE11.

The problem is that with this latest version there is some ES6 code coming (like const).

Richacinas avatar Jul 13 '22 09:07 Richacinas

Hi Please check on latest 3.3.1 version.

dmitry-kovalev avatar Jul 13 '22 13:07 dmitry-kovalev

Hi again!

Thanks for the prompt answer.

I tried again with the 3.3.1 version, and the error is different. It seems to be located in the remove-accents library code:

function extend(subject, baseObject) {
  subject = subject || {};
THIS LINE IS BREAKING THE BUNDLE IN IE11 --->  Object.keys(subject).forEach((key) => {
    baseObject[key] = !!subject[key];
  });
  return baseObject;
}

Richacinas avatar Jul 14 '22 07:07 Richacinas

It's quite strange because of 3.2.0 version contains same part of a code

function extend(subject, baseObject) {
  subject = subject || {};
  Object.keys(subject).forEach(function(key) {
    baseObject[key] = !!subject[key];
  });
  return baseObject;
}

And as I see this code was added exactly in 3.2.0. What worked version are you using now?

PS. I tried to build the latest version with and without polyfills, but it increase bundle size from 6K to 60K.

dmitry-kovalev avatar Jul 14 '22 09:07 dmitry-kovalev

We are using 3.1.1.. Wow, that's a massive increase of bundle size. I'm not sure how to go from there, to be honest.

Richacinas avatar Jul 14 '22 09:07 Richacinas

Hi After consulting with @moroshko I've fixed build and made separated distribs for old and modern browsers. Since 3.3.2 version if you need to support old browsers such IE11, you must import like

var match = require('autosuggest-highlight/ie11/match');
var parse = require('autosuggest-highlight/ie11/parse');

dmitry-kovalev avatar Jul 15 '22 07:07 dmitry-kovalev

I tried, but I'm getting the following error:

Module not found: Error: Can't resolve 'autosuggest-highlight/ie11/parse' in...

Checking on the folders created on node_modules, I don't see anything about ie11:

image

I confirmed I have version 3.2.2 on node_modules:

image

Richacinas avatar Jul 15 '22 09:07 Richacinas

Hi Sorry for delaying with answer. I've published version 3.3.3 with ie11 modules included.

dmitry-kovalev avatar Jul 22 '22 15:07 dmitry-kovalev