H2Owater425 / node-hitomi

Hitomi.la api for Node.js
https://npm.im/node-hitomi
MIT License
15 stars 2 forks source link

getGalleryData TypeError: Cannot read property 'push' of undefined #9

Closed dnm13 closed 3 years ago

dnm13 commented 3 years ago

I ran a simple test with this module with several id to try.

Some ids ran fine with getGalleryData, but 1316592 did not end well.

import { getGalleryData } from 'node-hitomi'
getGalleryData(1316592).then(console.log);

Error result:

(node:16524) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'push' of undefined
    at <anonymous>\node_modules\node-hitomi\library\index.js:1:2287
    at Array.forEach (<anonymous>)
    at <anonymous>\node_modules\node-hitomi\library\index.js:1:2241
    at Array.forEach (<anonymous>)
    at <anonymous>\node_modules\node-hitomi\library\index.js:1:2127
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:16524) 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:16524) [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.
H2Owater425 commented 3 years ago

First of all, thanks for making an issue about the error! I'll check what makes that error occurs, and fix it as fast as I can. And, by the way, which version of the package are you using?

dnm13 commented 3 years ago

v 1.2.0

H2Owater425 commented 3 years ago

Okay, I just released a new version of the package and found that it works fine (and I fixed the default module export). When you update the package to the latest version, that stupid error won't come out again. If you get any other problems while using this package. don't hesitate, make an issue like this please, thanks for your participation to make this project better!

wow_i_fixed_it