TS2371 in exceljs >= 1.9.0 (Typescript)
See original GitHub issueVersion 1.9.0 introduced a new issue in exceljs/index.d.ts.
ERROR in node_modules/exceljs/index.d.ts(787,17): error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
In an Angular (7) project, install exceljs 1.9.0 and add the following to tsconfig.json
"paths": {
"exceljs": ["../node_modules/exceljs/dist/exceljs.min"]
}
use ng serve and see TS2371
Downgrading to 1.8.0 solves the problem
Issue Analytics
- State:
- Created 4 years ago
- Reactions:15
- Comments:16 (1 by maintainers)
Top Results From Across the Web
TS2371 in exceljs >= 1.9.0 (Typescript) - Bountysource
ERROR in node_modules/exceljs/index.d.ts(787,17): error TS2371: A parameter initializer is only allowed in a function or constructor ...
Read more >4.3.0 - exceljs - npm
Read, manipulate and write spreadsheet data and styles to XLSX and JSON. Reverse engineered from Excel spreadsheet files as a project.
Read more >Can't export excel using ExcelJS - error TS2307: Cannot find ...
I was try to export an excel file using ExcelJS. Here is my console in VS Code terminal :
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
use import * as Excel from “exceljs/dist/exceljs.min.js”; instead of import { Workbook } from ‘exceljs’;
and declare let workbook = new Excel.Workbook();
I think line #789 of index.d.ts:
should be: