Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't resolve './cptable' #554

Closed
keyiis opened this issue Feb 8, 2017 · 6 comments
Closed

Can't resolve './cptable' #554

keyiis opened this issue Feb 8, 2017 · 6 comments

Comments

@keyiis
Copy link

keyiis commented Feb 8, 2017

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
@gongph
Copy link

gongph commented Mar 8, 2017

i hit the same error

@SheetJSDev
Copy link
Contributor

@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.

@nimatrazmjo
Copy link

nimatrazmjo commented Sep 22, 2018

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.

@abhinavkumar985
Copy link

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 ?

@denisoby
Copy link

denisoby commented Jun 5, 2019

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

@TheDemonMahesh
Copy link

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

saarCiklum pushed a commit to Folcon/js-xlsx that referenced this issue Aug 18, 2020
- codepage upgraded to 1.7.0
- remove require dark pattern (closes SheetJS#554 h/t @keyiis)
- test for JSON header disambiguation
- utility functions documentation (fixes SheetJS#424 h/t @dskrvk)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants