fastify/avvio

Regression: cannot prettyPrint

Eomm opened this issue · 1 comments

Eomm commented

Below sample can reproduce this problem with avvio@8.2.1:

const app = require('avvio')()
app.use(function first(instance, opts, cb) {
  console.log('plugins:', instance.prettyPrint())
  cb()
})

Output:

plugins: bound root undefined ms
└── first undefined ms

/Users/xuxucode/projects/avvio-sample/node_modules/avvio/time-tree.js:31
    if (labelNode.id) {
                  ^

TypeError: Cannot read properties of undefined (reading 'id')
    at [avvio.TimeTree.untrackNode] (/Users/xuxucode/projects/avvio-sample/node_modules/avvio/time-tree.js:31:19)
    at TimeTree.stop (/Users/xuxucode/projects/avvio-sample/node_modules/avvio/time-tree.js:94:25)
    at Plugin.<anonymous> (/Users/xuxucode/projects/avvio-sample/node_modules/avvio/boot.js:254:23)
    at Object.onceWrapper (node:events:626:26)
    at Plugin.emit (node:events:511:28)
    at done (/Users/xuxucode/projects/avvio-sample/node_modules/avvio/plugin.js:197:10)
    at check (/Users/xuxucode/projects/avvio-sample/node_modules/avvio/plugin.js:224:9)
    at node:internal/process/task_queues:140:7
    at AsyncResource.runInAsyncScope (node:async_hooks:206:9)
    at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8)

Node.js v20.1.0

Originally posted by @xuxucode in #156 (comment)

Fdawgs commented

Closed by #211