Sheetjs: Can't resolve './cptable'

Created on 8 Feb 2017  路  6Comments  路  Source: SheetJS/sheetjs

When i run sheetjs build xls,get below error:

ERROR in ./~/xlsx/dist/cpexcel.js
Module not found: Error: Can't resolve './cptable' in 'D:\work\nodejs\keypos\pos\node_modules\xlsx\dist'
resolve './cptable' in 'D:\work\nodejs\keypos\pos\node_modules\xlsx\dist'
  using description file: D:\work\nodejs\keypos\pos\node_modules\xlsx\package.json (relative path: ./dist)
    Field 'browser' doesn't contain a valid alias configuration
  after using description file: D:\work\nodejs\keypos\pos\node_modules\xlsx\package.json (relative path: ./dist)
    using description file: D:\work\nodejs\keypos\pos\node_modules\xlsx\package.json (relative path: ./dist/cptable)
      as directory
        D:\work\nodejs\keypos\pos\node_modules\xlsx\dist\cptable doesn't exist
      no extension
        Field 'browser' doesn't contain a valid alias configuration
        D:\work\nodejs\keypos\pos\node_modules\xlsx\dist\cptable doesn't exist
      .js
        Field 'browser' doesn't contain a valid alias configuration
        D:\work\nodejs\keypos\pos\node_modules\xlsx\dist\cptable.js doesn't exist
      .ts
        Field 'browser' doesn't contain a valid alias configuration
        D:\work\nodejs\keypos\pos\node_modules\xlsx\dist\cptable.ts doesn't exist
[D:\work\nodejs\keypos\pos\node_modules\xlsx\dist\cptable]
[D:\work\nodejs\keypos\pos\node_modules\xlsx\dist\cptable]
[D:\work\nodejs\keypos\pos\node_modules\xlsx\dist\cptable.js]
[D:\work\nodejs\keypos\pos\node_modules\xlsx\dist\cptable.ts]
 @ ./~/xlsx/dist/cpexcel.js 808:16-41
 @ ./~/xlsx/xlsx.js
ERROR in ./~/xlsx/dist/cpexcel.js
Module not found: Error: Can't resolve './cptable' in 'D:\work\nodejs\keypos\pos\node_modules\xlsx\dist'
resolve './cptable' in 'D:\work\nodejs\keypos\pos\node_modules\xlsx\dist'
  using description file: D:\work\nodejs\keypos\pos\node_modules\xlsx\package.json (relative path: ./dist)
    Field 'browser' doesn't contain a valid alias configuration
  after using description file: D:\work\nodejs\keypos\pos\node_modules\xlsx\package.json (relative path: ./dist)
    using description file: D:\work\nodejs\keypos\pos\node_modules\xlsx\package.json (relative path: ./dist/cptable)
      as directory
        D:\work\nodejs\keypos\pos\node_modules\xlsx\dist\cptable doesn't exist
      no extension
        Field 'browser' doesn't contain a valid alias configuration
        D:\work\nodejs\keypos\pos\node_modules\xlsx\dist\cptable doesn't exist
      .js
        Field 'browser' doesn't contain a valid alias configuration
        D:\work\nodejs\keypos\pos\node_modules\xlsx\dist\cptable.js doesn't exist
      .ts
        Field 'browser' doesn't contain a valid alias configuration
        D:\work\nodejs\keypos\pos\node_modules\xlsx\dist\cptable.ts doesn't exist
[D:\work\nodejs\keypos\pos\node_modules\xlsx\dist\cptable]
[D:\work\nodejs\keypos\pos\node_modules\xlsx\dist\cptable]
[D:\work\nodejs\keypos\pos\node_modules\xlsx\dist\cptable.js]
[D:\work\nodejs\keypos\pos\node_modules\xlsx\dist\cptable.ts]
 @ ./~/xlsx/dist/cpexcel.js 808:16-41
 @ ./~/xlsx/xlsx.js

Most helpful comment

@keyiis @gongph @jbutz @nengkuai @Scimonster @aarree @limjoe @emoragaf @imdzeeshan @jkurei @bdsoha @xiaofuchuan we are rolling out version 0.9.1 in which we reworked the codepage build process. That errant require has been removed.

All 6 comments

i hit the same error

@keyiis @gongph @jbutz @nengkuai @Scimonster @aarree @limjoe @emoragaf @imdzeeshan @jkurei @bdsoha @xiaofuchuan we are rolling out version 0.9.1 in which we reworked the codepage build process. That errant require has been removed.

Hey guys, I have the same problem using angular-cli 6.2.3 and angular 6. can anyone help me out. It works fine with webpack after adding './cptable': 'var cptable' to externals of webpack.

For some reason, I need to switch from webpack to angular-cli.

I do not know how to add './cptable': 'var cptable' in angular-cli @SheetJSDev .

Thanks in advance.

Hey guys, I have the same problem using angular-cli 6.2.3 and angular 6. can anyone help me out. It works fine with webpack after adding './cptable': 'var cptable' to externals of webpack.

For some reason, I need to switch from webpack to angular-cli.

I do not know how to add './cptable': 'var cptable' in angular-cli @SheetJSDev .

Thanks in advance.

I am also facing same issue with Angular cli 6.2.3 ?

Hi all! @abhinavkumar985 @nimatullah could you please tell if you found the workaround for the issue?

add declaration to cptable like
global.cptable = __webpack_require__(3);
remove "use strict" frpm those file

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gustavosimil picture gustavosimil  路  3Comments

jamesbillinger picture jamesbillinger  路  4Comments

goxr3plus picture goxr3plus  路  3Comments

mmancosu picture mmancosu  路  3Comments

magtuan picture magtuan  路  3Comments