google-fonts-webpack-plugin
google-fonts-webpack-plugin copied to clipboard
Muli download fail in webpack build
Hi! I tried to download Muli font in a not so older project (last build in novembre 2019) with webpack and got this error:
% building modules 358/358 modules 0 active(node:25615) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'map' of undefined at getVariantCss (PATH_TO_PROJECT/node_modules/google-fonts-webpack-plugin/src/GoogleWebfonts.js:23:25) at variants.forEach.variant (PATH_TO_PROJECT/node_modules/google-fonts-webpack-plugin/src/GoogleWebfonts.js:70:16) at Array.forEach (<anonymous>) at font.info.then.info (PATH_TO_PROJECT/node_modules/google-fonts-webpack-plugin/src/GoogleWebfonts.js:67:14) at process.internalTickCallback (internal/process/next_tick.js:77:7) (node:25615) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:25615) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I tried to replace this by another and works pretty well. Trid to use Muli in another project and it's failing with same code error. Do you guys get something on it ?? Thanks :)
This happened to an existing project of mine as well, currently looking for a fix/alternative.
I downloaded all required fonts with https://google-webfonts-helper.herokuapp.com/fonts and include them as static resources.
Did the same thing .... but shoudnt be the solution :) We cannot use multiple solutions on multiple projects :)
On Google Fonts Muli
has been renamed to Mulish
, which on the other hand works with the latest release.
So we can use Mulish
and stuff works as expected.
Can be validated by visiting the Google Font repo which is a fork of vernobile MuliFont.
i got the same error with the "Lato" font also