js-xlsx icon indicating copy to clipboard operation
js-xlsx copied to clipboard

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

Open ankita199 opened this issue 7 years ago • 12 comments

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?

ankita199 avatar Jan 05 '18 12:01 ankita199

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

gh0st avatar Jan 24 '18 16:01 gh0st

i came across this problem just now

chbro avatar Jan 30 '18 07:01 chbro

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

ginobili avatar Mar 08 '18 17:03 ginobili

see #90

protobi-pieter avatar Mar 08 '18 17:03 protobi-pieter

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?

sancit avatar Oct 03 '18 12:10 sancit

Thanks @sancit . It worked for me too.

celodauane avatar Mar 30 '20 15:03 celodauane

please npm i real-style-xlsx

reai99 avatar Feb 28 '22 10:02 reai99

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

kameshdhana avatar Mar 08 '22 11:03 kameshdhana

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;

ycy1621260121 avatar Aug 22 '22 06:08 ycy1621260121

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, 装这个包后还需要修改吗

matriox1003 avatar Jun 12 '23 09:06 matriox1003

please npm i real-style-xlsx

Thank you, I solved this problem.

iyu98 avatar Sep 18 '23 06:09 iyu98