linways/table-to-excel

Warnings when used with WebPack

knmr opened this issue · 4 comments

knmr commented

I'm getting warnings when I try to use this library with vue2 and webpack.

warning in ./node_modules/@linways/table-to-excel/dist/tableToExcel.js
1:261-262 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

warning in ./node_modules/@linways/table-to-excel/dist/tableToExcel.js
1:290-294 Critical dependency: the request of a dependency is an expression

same issue

Not sure what causes this warning. Parcel is used for bundling this library (not webpack).
Will try to recreate this issue.

Same here

image

This warning is caused by some dynamic dependency in one of the libraries in this project.
As mentioned here, this can be fixed using a webpack config hack.

module: {
        exprContextCritical: false,
         ...
}

You can also use ContextReplacementPlugin to fix this.