Android-KitKat / twikoo-import-tools-typecho

Typecho 到 Twikoo 迁移脚本
MIT License
6 stars 1 forks source link

bug #1

Closed eallion closed 3 years ago

eallion commented 3 years ago
(node:7590) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'twikoo' of undefined
    at getParentID (/home/eallion/Documents/twikoo-import-tools-typecho/migrator-comment.js:186:20)
    at convert (/home/eallion/Documents/twikoo-import-tools-typecho/migrator-comment.js:235:22)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async run (/home/eallion/Documents/twikoo-import-tools-typecho/migrator-comment.js:262:42)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:7590) 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:7590) [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.
Android-KitKat commented 3 years ago

通过刚才的QQ交流来看。 应该是因为我以评论都是按顺序来的为前提导致的。

你错误的那条评论,父级指向了更之后的评论。 而程序还没有读取到更之后的评论,所以发生了错误。

现在我改成了先读取全部评论,再生成导入数据。 代码已经提交了,你有时间可以再试一下。