HalitTalha / ng-material-extensions

Extended features for @angular/material components
Apache License 2.0
101 stars 52 forks source link

Import from XLSX dist folder causing errors #106

Closed pongells closed 3 years ago

pongells commented 3 years ago

Is this intentional?

https://github.com/HalitTalha/ng-material-extensions/blob/129187e2ebceaa37127f2eecf18ccf3f203afc16/projects/cdk-table-exporter/src/lib/services/exporters/xls-exporter.service.ts#L2

I am getting errors when trying to serve and angular app.. even after adding @types/xlsx:

ERROR in node_modules/cdk-table-exporter/lib/options.d.ts:1:32 - error TS7016: Could not find a declaration file for module 'xlsx/dist/xlsx.mini.min'. '/node_modules/xlsx/dist/xlsx.mini.min.js' implicitly has an 'any' type. Try npm install @types/xlsx if it exists or add a new declaration (.d.ts) file containing declare module 'xlsx/dist/xlsx.mini.min';

1 import { WritingOptions } from 'xlsx/dist/xlsx.mini.min';

node_modules/cdk-table-exporter/lib/services/exporters/csv-exporter.service.d.ts:2:23 - error TS7016: Could not find a declaration file for module 'xlsx/dist/xlsx.mini.min'. '/node_modules/xlsx/dist/xlsx.mini.min.js' implicitly has an 'any' type.
Try `npm install @types/xlsx` if it exists or add a new declaration (.d.ts) file containing `declare module 'xlsx/dist/xlsx.mini.min';`

2 import * as XLSX from 'xlsx/dist/xlsx.mini.min';

node_modules/cdk-table-exporter/lib/services/exporters/worksheet-exporter.d.ts:1:23 - error TS7016: Could not find a declaration file for module 'xlsx/dist/xlsx.mini.min'. '/node_modules/xlsx/dist/xlsx.mini.min.js' implicitly has an 'any' type. Try npm install @types/xlsx if it exists or add a new declaration (.d.ts) file containing declare module 'xlsx/dist/xlsx.mini.min';

1 import * as XLSX from 'xlsx/dist/xlsx.mini.min';


node_modules/cdk-table-exporter/lib/services/exporters/xls-exporter.service.d.ts:1:23 - error TS7016: Could not find a declaration file for module 'xlsx/dist/xlsx.mini.min'. '/node_modules/xlsx/dist/xlsx.mini.min.js' implicitly has an 'any' type.
Try `npm install @types/xlsx` if it exists or add a new declaration (.d.ts) file containing `declare module 'xlsx/dist/xlsx.mini.min';`
HalitTalha commented 3 years ago

Thanks for reporting. This was intentional to keep the bundle size smaller. We will try to fix as soon as possible.

Kytol commented 3 years ago

I downloaded:

npm install --save mat-table-exporter@10.2.2

And didn't receive this same error anymore.

HalitTalha commented 3 years ago

You won't be getting this with the latest version 10.2.3