patrickhulce / fontmin-webpack

Minifies icon fonts to just the used glyphs.
MIT License
139 stars 19 forks source link

UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside #34

Closed ppttfish closed 3 years ago

ppttfish commented 3 years ago

(node:4968) [DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET_LENGTH] DeprecationWarning: Compilation.modules was changed from Array to Set (using Array property 'length' is deprecated) (node:4968) [DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET_INDEXER] DeprecationWarning: Compilation.modules was changed from Array to Set (indexing Array is deprecated) (node:4968) UnhandledPromiseRejectionWarning: TypeError: Cannot convert undefined or null to object at Function.from () at D:\data\webpack-demo\test\node_modules\fontmin-webpack\lib\index.js:47:32 at arrayMap (D:\data\webpack-demo\test\node_modules\lodash\lodash.js:639:23) at Function.map (D:\data\webpack-demo\test\node_modules\lodash\lodash.js:9580:14) at interceptor (D:\data\webpack-demo\test\node_modules\lodash\lodash.js:17046:35) at Function.thru (D:\data\webpack-demo\test\node_modules\lodash\lodash.js:8817:14) at D:\data\webpack-demo\test\node_modules\lodash\lodash.js:4388:28 at arrayReduce (D:\data\webpack-demo\test\node_modules\lodash\lodash.js:683:21) at baseWrapperValue (D:\data\webpack-demo\test\node_modules\lodash\lodash.js:4387:14) at LodashWrapper.wrapperValue (D:\data\webpack-demo\test\node_modules\lodash\lodash.js:9072:14) (node:4968) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:4968) [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.

webpack.config.js plugins: [ new FontminPlugin({ glyphs: ['明月'] }) ]

what should i do

patrickhulce commented 3 years ago

Thanks for filing @ppttfish! Are you using this with webpack 5?

patrickhulce commented 3 years ago

f306975 converts this to a warning instead of a fatal error, but if you are using v5 and can provide a full webpack config that repros this failure I'm happy to take another look :)