Search code examples
angular6xlsxjs-xlsx

Getting error for xlsx-style after entering command 'yarn start'


i imported xlsx-style package to style my xlsx stylesheet,then i did 'yarn start'.after that i got error here am attaching error

Error:

Webpack: Finished after 84.273 seconds.

ERROR Failed to compile with 3 errors 4:08:23 PM

This dependency was not found:

  • fs in ./node_modules/xlsx-style/xlsx.js, ./node_modules/xlsx-style/ods.js

To install it, you can run: npm install --save fs

This relative module was not found:

  • ./cptable in ./node_modules/xlsx-style/dist/cpexcel.js ERROR in /home/administrator/Documents/jan21/pgh/src/main/webapp/app/entities/configuration/financial-year-settings.component.ts(37,9): TS2305: Module '"/home/administrator/Documents/jan21/pgh/src/main/webapp/app/entities/service/calendarexcel.service"' has no exported member 'CalendarExcelService'. Version: typescript 2.7.2 Time: 54018ms ✖ 「wdm」: 1772 modules

Solution

  • i fixed my error by giving this code in webpack.config.js,here code is :

    node: {
     fs: 'empty'
     },
     externals: [ {
     './cptable': 'var cptable' 
    } ]