HalitTalha / ng-material-extensions

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

"cdk-table-exporter" warning with "xlsx" #133

Open NevenLiang opened 2 years ago

NevenLiang commented 2 years ago
Warning: 
[PROJECT_PATH]/node_modules/cdk-table-exporter/__ivy_ngcc__/fesm2015/cdk-table-exporter.js depends on 'xlsx'. 
CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: 
[PROJECT_PATH]/node_modules/cdk-table-exporter/__ivy_ngcc__/fesm2015/cdk-table-exporter.js depends on 
'xlsx/dist/xlsx.mini.min'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

I am using Angular 12 and mat-table-exporter 10.2.3.

jules1091 commented 2 years ago

Same with Angular 13 and mat-table-exporter 10.2.4

CamClark1995 commented 2 years ago

You can silence this warning by adding the following to your angular.json file under "builder": "@angular-devkit/build-angular:browser":

"allowedCommonJsDependencies": [ "xlsx" ]

HalitTalha commented 1 year ago

This is an unavoidable warning for now. Thanks, @CamClark1995, for sharing how to silence the warning.

vasudevaraopaila commented 1 year ago

Hi, to fix the snyk issue in mat table exporter package due to the xlsx dependency,I have published two packages to replacing mat table exporter and cdk table exporter(copied from these two and changed names), and added @e965/xlsx as a dependency for cdk table exporter. But the compilation is failing by throwing the below issues.

./node_modules/config-table-exporter/fesm2020/cdk-table-exporter.mjs:130:21-54 - Error: Module not found: Error: Can't resolve 'xlsx/dist/xlsx.mini.min' in 'D:\Projects\Config Hub\ba-configHub-UI\Config-Hub-Main\node_modules\config-table-exporter\fesm2020'

./node_modules/config-table-exporter/fesm2020/cdk-table-exporter.mjs:132:21-35 - Error: Module not found: Error: Can't resolve 'xlsx' in 'D:\Projects\Config Hub\ba-configHub-UI\Config-Hub-Main\node_modules\config-table-exporter\fesm2020'

Adding the packages below for reference https://www.npmjs.com/package/config-mat-table-exporter?activeTab=code https://www.npmjs.com/package/config-table-exporter?activeTab=code

any help would be appreciated.