jimp-dev / gifwrap

A Jimp-compatible library for working with GIFs
MIT License
71 stars 17 forks source link

(node:1893) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'getMaxDimensions' of undefined #14

Open shuaihuajun opened 5 years ago

shuaihuajun commented 5 years ago

(node:1893) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'getMaxDimensions' of undefined at GifCodec.encodeGif (/Users/chenshuaihua/gifwrap-guide/node_modules/gifwrap/src/gifcodec.js:99:34) at Object.exports.write (/Users/chenshuaihua/gifwrap-guide/node_modules/gifwrap/src/gifutil.js:232:20) at Object.<anonymous> (/Users/chenshuaihua/gifwrap-guide/index.js:10:9) at Module._compile (internal/modules/cjs/loader.js:689:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3) at Function.Module.runMain (internal/modules/cjs/loader.js:742:12) at startup (internal/bootstrap/node.js:279:19) (node:1893) 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: 2) (node:1893) [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.

jtlapp commented 5 years ago

It looks like there is a problem with the way I'm managing circular dependencies. The error happens when the GifUtil module hasn't been loaded yet. Thanks for reporting.