exceljs: [BUG] Angular 9 support?
🐛 Bug Report
After updating my angular application to v9, I’m getting the following errors:
ERROR in node_modules/exceljs/index.d.ts:1284:22 - error TS2307: Cannot find module 'stream'.
1284 read(stream: import('stream').Stream): Promise<Workbook>;
~~~~~~~~
node_modules/exceljs/index.d.ts:1310:23 - error TS2307: Cannot find module 'stream'.
1310 write(stream: import('stream').Stream, options?: Partial<XlsxWriteOptions>): Promise<void>;
~~~~~~~~
node_modules/exceljs/index.d.ts:1332:22 - error TS2307: Cannot find module 'stream'.
1332 read(stream: import('stream').Stream, options?: Partial<CsvReadOptions>): Promise<Worksheet>;
~~~~~~~~
node_modules/exceljs/index.d.ts:1352:23 - error TS2307: Cannot find module 'stream'.
1352 write(stream: import('stream').Stream, options?: Partial<CsvWriteOptions>): Promise<void>;
~~~~~~~~
node_modules/exceljs/index.d.ts:1649:19 - error TS2307: Cannot find module 'stream'.
1649 stream: import('stream').Stream;
Lib version: X.Y.Z
Steps To Reproduce
- Just update the angular application to version 9.
My current application dependencies:
"dependencies": {
"@angular/animations": "^9.0.4",
"@angular/cdk": "^9.1.0",
"@angular/common": "^9.0.4",
"@angular/compiler": "^9.0.4",
"@angular/core": "^9.0.4",
"@angular/forms": "^9.0.4",
"@angular/http": "^7.2.16",
"@angular/material": "^9.1.0",
"@angular/platform-browser": "^9.0.4",
"@angular/platform-browser-dynamic": "^9.0.4",
"@angular/router": "^9.0.4",
"@asymmetrik/angular2-leaflet": "^2.2.1",
"@auth0/angular-jwt": "^4.0.0",
"@ngx-lite/input-switch": "^0.3.3",
"@types/geojson": "^7946.0.7",
"@types/leaflet": "^1.5.9",
"ag-grid-angular": "^22.1.1",
"ag-grid-community": "^22.1.1",
"angular2-jwt": "0.2.3",
"angular2-multiselect-dropdown": "^4.6.3",
"bootstrap": "^4.4.1",
"chart.js": "^2.9.3",
"chartjs-plugin-annotation": "^0.5.7",
"chartjs-plugin-labels": "^1.1.0",
"chartjs-plugin-title-click": "^1.0.0",
"core-js": "^3.6.4",
"exceljs": "^3.8.0",
"file-saver": "^2.0.2",
"jquery": "^3.4.1",
"leaflet": "^1.3.4",
"leaflet-extra-markers": "^1.2.1",
"ng2-charts": "^2.3.0",
"ng2-sticky-nav": "^6.1.0",
"ngx-bootstrap": "^5.3.2",
"ngx-mat-select-search": "^2.1.1",
"ngx-pagination": "^5.0.0",
"ngx-toggle-switch": "^2.0.5",
"node-sass": "^4.13.1",
"rxjs": "^6.5.4",
"xlsx": "^0.15.5",
"zone.js": "^0.10.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.900.4",
"@angular/cli": "^9.0.4",
"@angular/compiler-cli": "^9.0.4",
"@angular/language-service": "^9.0.4",
"@types/jasmine": "^3.5.7",
"@types/jasminewd2": "^2.0.8",
"@types/node": "^13.7.6",
"codelyzer": "^5.2.1",
"jasmine-core": "^3.5.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "^4.4.1",
"karma-chrome-launcher": "^3.1.0",
"karma-coverage-istanbul-reporter": "^2.1.1",
"karma-jasmine": "^3.1.1",
"karma-jasmine-html-reporter": "^1.5.2",
"protractor": "^5.4.3",
"ts-node": "^8.6.2",
"tslint": "^6.0.0",
"typescript": "~3.7.5"
}
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 3
- Comments: 15
“types”: [“node”]. Add this to tsconfig.app.json file. Worked for me.
I added paths in tsconfig.app.json
“types”: [“node”], funciona, hay que agregar en el archivo tsconfig.app.json
“types”: [“node”]. Add this to tsconfig.app.json file. Worked for me.
this has worked for me.
angular.json
include the following line in script block. “./node_modules/exceljs/dist/exceljs.min.js”
package.json
include exceljs and file-saver dependency
export-excel.service.ts
import the dependencies in the component or service to use.
I’m using now Angular 11.xx.x and using this configuration doesn’t work for me, but I modify it like this, and now it’s working…
“types”: [“node”]. Add this to tsconfig.app.json file. Worked for me.
@bhavan0 Please have a look at this link https://github.com/aws-amplify/docs/issues/273 also this https://github.com/exceljs/exceljs/issues/1008