material-table icon indicating copy to clipboard operation
material-table copied to clipboard

v1.68.1 and v1.69.0 use jsPDF v2.0 which throws warning

Open merobal opened this issue 6 years ago • 25 comments

After upgrading to v1.68.1 I get this in the console:

Compiled with warnings.

./node_modules/jspdf/dist/jspdf.umd.min.js
Critical dependency: the request of a dependency is an expression

Probably related: https://github.com/MrRio/jsPDF/issues/2846

Caused by: https://github.com/mbrn/material-table/pull/2311

merobal avatar Aug 16 '20 19:08 merobal

Confirmed; after merging that change, our builds immediately started failing. Will pin to an older version of material-table for now.

freben avatar Aug 17 '20 07:08 freben

I rolled back from 1.68.1 down to 1.68.0 and the warnings are gone. I can now successfully build my React App (whereas build warnings are considered a failure in my CI/CD).

Just my opinion, I don't see how upgrading a major version of a dependency, in this case from [email protected] to [email protected], constitutes a patch version in the material-table library. I would think it would at least be a minor version change.

benrobot avatar Aug 17 '20 20:08 benrobot

Hi, I'm having the same issues:

Output from react-scripts start (I'm using TypeScript):

Compiled with warnings.

./node_modules/jspdf/dist/jspdf.umd.min.js
Critical dependency: the request of a dependency is an expression

./node_modules/jspdf/dist/jspdf.umd.min.js
Critical dependency: the request of a dependency is an expression

Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.

npm list jspdf:

$ npm list jspdf
[email protected] 
└─┬ [email protected]
  └── [email protected] 

jakub-bao avatar Aug 18 '20 15:08 jakub-bao

I was extremely surprised to see material-table depends on jsPDF for a feature that most of us aren't probably even using... Hopefully this dependency will become optional in the near feature see #2164 #2168

benjaminvdb avatar Aug 19 '20 15:08 benjaminvdb

Downgrade jspdf to v1.5.3. It works for me. Warning doesn't appear again.

Jabarbasith avatar Aug 20 '20 07:08 Jabarbasith

downgraded to material 1.67 worked for me, hope it will be solved soon

victororlyk avatar Aug 21 '20 09:08 victororlyk

downgraded to material 1.67 worked for me, hope it will be solved soon

@victororlyk You could also opt for downgrading to the previous version of material-table: 1.68.0 .

benjaminvdb avatar Aug 21 '20 09:08 benjaminvdb

@benjaminvdb , thanks it is also working.

victororlyk avatar Aug 21 '20 09:08 victororlyk

Do we have any news regarding this? I feel the pdf thing add a lot of code and has warnings

gpessa avatar Aug 24 '20 11:08 gpessa

The jspdf team will release a new version with the fix within days https://github.com/MrRio/jsPDF/issues/2846#issuecomment-678150676 And that version should be pinned in this repo after the release.

merobal avatar Aug 24 '20 11:08 merobal

Thanks to @merobal for the info that using jspdf@^2.1.0 fix this issue.

If using yarn you can pin jspdf version to ^2.1.0 in your project's package.json for temporary fix.

"resolutions": {
	"material-table/jspdf": "^2.1.0"
}

hendra-go avatar Aug 27 '20 10:08 hendra-go

Use "postinstall": "cd ./node_modules/material-table && npm install [email protected]" for temporary fix.

slzno avatar Aug 29 '20 18:08 slzno

Also reproducible with material-table 1.69.0.

thSoft avatar Sep 01 '20 14:09 thSoft

A path version with the fixes is not yet released. 1.69.0 doesn't contain the fix

merobal avatar Sep 01 '20 14:09 merobal

@merobal All waiting the version 1.69.1.

slzno avatar Sep 01 '20 14:09 slzno

Does it work with newest material-table, in case of issues with the table look at: https://github.com/MrRio/jsPDF/issues/2846

TomaszWaszczyk avatar Sep 03 '20 08:09 TomaszWaszczyk

Are there any updates on this?

YaroslavAntipov avatar Sep 09 '20 14:09 YaroslavAntipov

any updates?

harveyconnor avatar Sep 20 '20 12:09 harveyconnor

Still waiting for @mbrn to release the fixes

merobal avatar Sep 20 '20 14:09 merobal

Still have issue...

1ur11 avatar Sep 23 '20 09:09 1ur11