Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An error occurs on polyfills.js in IE11 when using with core-js library #2647

Closed
kkc-yuki opened this issue Mar 2, 2020 · 4 comments
Closed
Labels
Possible Bug A possible bug that needs investigation

Comments

@kkc-yuki
Copy link

kkc-yuki commented Mar 2, 2020

Describe the bug
When I try to use this Tabulator with core-js (https://github.com/zloirock/core-js),
the following error code appear on IE11 browser's console.

cannot redefine non-configurable property 'find'

Same issue is here.
zloirock/core-js#746

If I delete the code in src/js/polyfills.js, or dist/js/tabulator.js from 20 to 177,
it works fine.

Tabulator Info
4.5.3

Working Example
Please open with Internet Explorer 11.
https://jsbin.com/fiyadipifi/2/edit?html,js,console,output

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
  <script src="https://unpkg.com/[email protected]/dist/js/tabulator.min.js"></script>
  <script src="https://unpkg.com/[email protected]/index.js"></script>
  <script>
    console.log([1,2,3].find(function(x){
      return x === 2;
    }));
  </script>
  </head>
<body>

</body>
</html>

In webpack, the following code is a sample.

require('tabulator-tables');
require("core-js/stable");

console.log([1,2,3].find(function(x){
      return x === 2;
}));

To Reproduce

  1. Require both Tabulator and core-js (if you use webpack).
  2. Run the server.
  3. Access the server using IE11.
  4. See error

Expected behavior
Can access the server without error.

Desktop (please complete the following information):

  • OS: Windows
  • Browser: Internet Explorer
  • Version: 11

Additional context

My suggestion:
Could you eliminate the code I mentioned above and release that version next?

I will appreciate your help with this situation.

@kkc-yuki kkc-yuki added the Possible Bug A possible bug that needs investigation label Mar 2, 2020
@kkc-yuki
Copy link
Author

kkc-yuki commented Mar 2, 2020

As the example code was wrong, I edited the issue.

@olifolkerd
Copy link
Owner

Hey @kkc-yuki

That is likely because the two libraries are attempting to apply the same polyfills in different ways. if you are using core.js you probably dont need polyfill.js as it does much more than the Tabulator polyfill file.

Cheers

Oli :)

@kkc-yuki
Copy link
Author

Hi @olifolkerd ,

Thanks for replying!

Did you mean that I do not have to use Tabulator's polyfill file?
If that case, are you going to think about releasing the version without polyfill?
Or should I just eliminate the Tabulator's polyfill file and build them by myself?

Many thanks,

kkc-yuki

@olifolkerd
Copy link
Owner

olifolkerd commented Mar 23, 2020

The pollyfill.js file is just there to make up for missing functions in the IE browsers and is optionally included by developers to make Tabulator work on a site that is used on IE.

If you are including core.js then that is already replacing the missing browser functionality so there is no need to include the polyfill.

It has nothing to do with the Tabulator build or the release. In your useage case because you are already polyfilling the missing browser functionality you simply don't need the polyfil.js in your project. As long as you include tabulator.js after core.js you should be fine.

The file is there for those that need it. You can simply choose not to in your usage case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Possible Bug A possible bug that needs investigation
Projects
None yet
Development

No branches or pull requests

2 participants