Sheetjs: Doesn't work in webpack: Can't resolve '../xlsx.js'

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

look this:

WARNING in ./~/xlsx/ods.js
Module not found: Error: Can't resolve '../xlsx.js' in 'F:\gittest\js-office-demo\node_modules\xlsx'

 @ ./~/xlsx/ods.js 10:9-30
 @ ./~/xlsx/xlsx.js
 @ ./src/index.js

ERROR in ./~/xlsx/dist/cpexcel.js
Module not found: Error: Can't resolve './cptable' in 'F:\gittest\js-office-demo\node_modules\xlsx\d
ist'
 @ ./~/xlsx/dist/cpexcel.js 808:16-41
 @ ./~/xlsx/xlsx.js
 @ ./src/index.js

Most helpful comment

Failed to compile.

./node_modules/tempa-xlsx/ods.js
Module not found: Can't resolve 'xlsx' in 'D:\OFFICE\workspace\geo\node_modules\tempa-xlsx'

please can solve this issue I am not getting what to do?????

install the following package it's working
npm install xlsx

All 6 comments

right now, you can suppress those in the webpack config. The webpack demo (in the demos/webpack subdirectory of the git repo) has the following

    externals: [
        {
            './cptable': 'var cptable',
            '../xlsx.js': 'var _XLSX'
        }
    ]

Soon we will rework the codepage library to omit the require statement and fold the ODS code into the main script. Keep the issue open until then.

Dear, thank you very much. The problem has been solved! @SheetJSDev

Failed to compile.

./node_modules/tempa-xlsx/ods.js
Module not found: Can't resolve 'xlsx' in 'D:\OFFICE\workspace\geo\node_modules\tempa-xlsx'

please can solve this issue I am not getting what to do?????

Failed to compile.

./node_modules/tempa-xlsx/ods.js
Module not found: Can't resolve 'xlsx' in 'D:\OFFICE\workspace\geo\node_modules\tempa-xlsx'

please can solve this issue I am not getting what to do?????

install the following package it's working
npm install xlsx

I've read tons of related topics and tried everything. But in my case this helped:
In webpack config in externals replace { "../xlsx.js": "var _XLSX" } with { "../xlsx": "var _XLSX" }

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gustavosimil picture gustavosimil  路  3Comments

happy0088 picture happy0088  路  3Comments

dullin picture dullin  路  3Comments

DannyRyman picture DannyRyman  路  3Comments

sudhakar-sekar picture sudhakar-sekar  路  3Comments