protobi / js-xlsx

XLSX / XLSM / XLSB (Excel 2007+ Spreadsheet) / ODS parser and writer
http://oss.sheetjs.com/js-xlsx
Other
817 stars 417 forks source link

Module not found #78

Open jgoodall628 opened 7 years ago

jgoodall628 commented 7 years ago

Error in ./~/xlsx-style/dist/cpexcel.js Module not found: ./cptable

artemverbo commented 7 years ago

Same issue when attempting to use via Webpack

Khanji commented 7 years ago

It seems that there is a bug in the xlsx-style/dist/cpexcel.js file.

(function(root, factory){ "use strict"; if(typeof cptable === "undefined") { if(typeof require !== "undefined"){ var cpt = require('cpt' + 'able'); <<--

The last line should be: var cpt = cptable;

This will fix your problem

You'll find this piece of code starting on line 803 in the mentioned file

luwojtaszek commented 6 years ago

In my Angular4 application I'm using:

I found that you can also fix this problem by replacing xlsx-style/dist/cpexcel.js with xlsx/dist/cpexcel.js file.

VaskaDagamas commented 6 years ago

@Khanji Thank's on one error less, may your know some about: ERROR in ./~/xlsx-style/xlsx.js Can't resolve 'fs' in '/home/vasil/workplace/CientApp_SplitCode/node_modules/xlsx-style'

ERROR in ./~/xlsx-style/ods.js Can't resolve 'fs' in '/home/vasil/workplace/CientApp_SplitCode/node_modules/xlsx-style'

maxxt commented 6 years ago

Will this issue be fixed anytime soon?

dstvishnu commented 6 years ago

When this issue will be fixed and the package will be available in the npm package

dbwcooper commented 6 years ago

i meet this question

Failed to compile.

Error in ./~/xlsx-style/ods.js Module not found: 'xlsx' in D:\dva-excel\node_modules\xlsx-style

@ ./~/xlsx-style/ods.js 13:21-41

so , in 13 line xlsx-style/ods.js , i found : catch(ee) { return require('xl' + 'sx').utils; } change : catch(ee) { return require('./xlsx').utils; }