ng-material-extensions icon indicating copy to clipboard operation
ng-material-extensions copied to clipboard

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

Open NevenLiang opened this issue 2 years ago • 4 comments

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.

NevenLiang avatar Nov 23 '21 17:11 NevenLiang

Same with Angular 13 and mat-table-exporter 10.2.4

jules1091 avatar Dec 17 '21 07:12 jules1091

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

"allowedCommonJsDependencies": [ "xlsx" ]

CamClark1995 avatar Mar 01 '22 16:03 CamClark1995

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

HalitTalha avatar Mar 22 '23 06:03 HalitTalha

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.

vasudevaraopaila avatar Sep 27 '23 09:09 vasudevaraopaila