exceljs / exceljs

Excel Workbook Manager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lib contains class syntax, not compatible with IE11

yoyo837 opened this issue · comments

I think if you need IE11 support you would have to use the ES5 files instead, e.g. https://unpkg.com/exceljs@3.2.0/dist/es5/csv/csv.js

Importing the es5 version doesn't fix the issue for me using webpack.

I'm importing the lib like this
import ExcelJS from 'exceljs/dist/es5/exceljs.browser.js'

The webpack created chunk-vendors includes class definitions thereby breaking the bundled code in Internet Explorer 11. Modern browsers work fine. I have identified exceljs to be the source of the problem. This started happening from version 3, and the switch to modern JS as the default.

I've tried deleting everything from the module except the es5 files. I've tried resetting values in the package.json to how they were in version 2. Nothing helped.

I'm out of ideas.

Fixed in v3.3.0

Added a monkey-patch that adds a browserify property to the fast-csv package.json before the build. Longer term will try to have it PR'd into the package properly

Still having the same class definitions in my chunk-vendors. Do I need to import the lib differently?

Can confirm, that the issue exists in 3.3.0.

I confirm too: the problem still exists in 3.3.0

Got a solution that works with the way I'm using webpack. I use Vue-Cli where I now added
transpileDependencies:['fast-csv']
To my vue.config.js

This did the trick for me. The newest version of the lib now works in IE 11.

See https://cli.vuejs.org/config/#transpiledependencies

Change the exclude expression in your babel config to include the fast-csv lib, if you are using babel with webpack outside of Vue-Cli. By default all node_modules get ignored by babel.

commented

We need the library used by the browser script tag.

@yoyo837 I assume you want to include the lib directly into the document? In this case you should use the version in the /dist/es5/ directory. guyonroche's fix should apply there and make it work.