Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error on yarn install: Argument of type 'FontFace' is not assignable to parameter of type 'global.FontFace' #432

Closed
oxygen-xx opened this issue Nov 17, 2021 · 8 comments · Fixed by #434
Labels
bug dependencies Pull requests that update a dependency file

Comments

@oxygen-xx
Copy link

oxygen-xx commented Nov 17, 2021

yarn install 
error : 
react-to-print/src/index.tsx(275,68)       
TS2345: Argument of type 'FontFace' is not assignable to parameter of type 'global.FontFace'.
 Type 'FontFace' provides no match for the signature 'new (family: string, source: string | ArrayBuffer, descriptors?: FontFaceDescriptors | undefined): FontFace'.
@MatthewHerbst MatthewHerbst changed the title yarn install ,error : react-to-print/src/index.tsx(275,68) TS2345: Argument of type 'FontFace' is not assignable to parameter of type 'global.FontFace'. error on yarn install: Argument of type 'FontFace' is not assignable to parameter of type 'global.FontFace' Nov 17, 2021
@MatthewHerbst
Copy link
Owner

Hello. Can you please show what versions of yarn, react-to-print, and typescript you are using?

@oxygen-xx
Copy link
Author

oxygen-xx commented Nov 18, 2021

Hello. Can you please show what versions of yarn, react-to-print, and typescript you are using?

macos 12
Yarn, 1.22.17
react-to-print , 2.14.0
typescript , 4.5.2

@MatthewHerbst
Copy link
Owner

Thanks for the information. I'm not able to replicate the error. Do you have anything else configured? Could you maybe share your package.json and tsconfig.json files please?

Screen Shot 2021-11-18 at 10 43 38 AM

@oxygen-xx
Copy link
Author

I just cloned this project, and then yarn install

git clone https://github.com/gregnb/react-to-print.git
yarn install

@MatthewHerbst
Copy link
Owner

This seems to be something to do with a breaking change in TypeScript, since it works with earlier versions. Should have a fix out shortly, thank you

@MatthewHerbst MatthewHerbst added bug dependencies Pull requests that update a dependency file labels Nov 22, 2021
@MatthewHerbst
Copy link
Owner

The breaking change occurred specifically in TypeScript v4.4. It seems TypeScript added FontFace to it's lib files, so we seemingly don't need to define the interface anymore! microsoft/TypeScript-DOM-lib-generator#1029 (comment) Working on the fix now

@MatthewHerbst
Copy link
Owner

The fix for this has been published in v2.14.1, please let me know if you run into any other issues. Thank you!

@oxygen-xx
Copy link
Author

The fix for this has been published in v2.14.1, please let me know if you run into any other issues. Thank you!

thank you , 2.14.1 is fine!.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants