protobi / js-xlsx

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

Can't resolve './cptable' in 'myPath\node_modules\xlsx-style\dist' #100

Open ankita199 opened 6 years ago

ankita199 commented 6 years ago

Hi,

I am gettin cptable cant resolve error while running the project. I have added 'xlsx-style' module in my app for apply styling in xls. I am using angular - 4.3.1 and latest version of this module 0.8.13. ref https://github.com/protobi/js-xlsx/issues/78

when this issue will be resolved?

gh0st commented 6 years ago

This is a good question. There should be a PR for this.

chbro commented 6 years ago

i came across this problem just now

ginobili commented 6 years ago

I have this issue aswell. When is the PR getting merged?

pietersv commented 6 years ago

see #90

sancit commented 6 years ago

I end up with couple of compile errors when using with angular-cli

ERROR in ./node_modules/xlsx-style/dist/cpexcel.js Module not found: Error: Can't resolve 'cptable' in 'C:\buildareas\head\issdev\src\javascript\APFAnalytics\node_modules\xlsx-style\dist' ERROR in ./node_modules/xlsx-style/ods.js Module not found: Error: Can't resolve 'xlsx' in 'C:\buildareas\head\issdev\src\javascript\APFAnalytics\node_modules\xlsx-style'

I had to make couple of changes

  1. In cpexcel.js file change var cpt = require('./cptable') to var cpt = cptable
  2. In ods.js file change require('xlsx') to require('./xlsx')

The first change is actually fixed in the main SheetJs/js-xlsx library, since this is a fork of it we need to change it

Can the above two changes incorporated into the master? or do you want me to make a new fork of this and put my changes in?

celodauane commented 4 years ago

Thanks @sancit . It worked for me too.

reai99 commented 2 years ago

please npm i real-style-xlsx

kameshdhana commented 2 years ago

I end up with couple of compile errors when using with angular-cli

ERROR in ./node_modules/xlsx-style/dist/cpexcel.js Module not found: Error: Can't resolve 'cptable' in 'C:\buildareas\head\issdev\src\javascript\APFAnalytics\node_modules\xlsx-style\dist' ERROR in ./node_modules/xlsx-style/ods.js Module not found: Error: Can't resolve 'xlsx' in 'C:\buildareas\head\issdev\src\javascript\APFAnalytics\node_modules\xlsx-style'

I had to make couple of changes

  1. In cpexcel.js file change var cpt = require('./cptable') to var cpt = cptable
  2. In ods.js file change require('xlsx') to require('./xlsx')

The first change is actually fixed in the main SheetJs/js-xlsx library, since this is a fork of it we need to change it

Can the above two changes incorporated into the master? or do you want me to make a new fork of this and put my changes in?

Can you just provide the line of code where we need to make the change in ods.js file

ycy1621260121 commented 2 years ago

npm install xlsx-style-hzx 1、cpexcel.js 的807行 var cpt = require('./cpt' + 'able') 改为 var cpt = require('./cpexcel'); 2、xlsx.js中var current_codepage = 1200, current_cptable;加上一个cptable;即var current_codepage = 1200, current_cptable, cptable;

matriox1003 commented 1 year ago

npm install xlsx-style-hzx 1、cpexcel.js 的807行 var cpt = require('./cpt' + 'able') 改为 var cpt = require('./cpexcel'); 2、xlsx.js中var current_codepage = 1200, current_cptable;加上一个cptable;即var current_codepage = 1200, current_cptable, cptable;

xlsx-style-hzx, 装这个包后还需要修改吗

iyu98 commented 1 year ago

please npm i real-style-xlsx

Thank you, I solved this problem.