Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: cannot prettyPrint #205

Closed
Eomm opened this issue Jun 11, 2023 · 1 comment
Closed

Regression: cannot prettyPrint #205

Eomm opened this issue Jun 11, 2023 · 1 comment
Labels
bug Confirmed bug good first issue Good for newcomers

Comments

@Eomm
Copy link
Member

Eomm commented Jun 11, 2023

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)

@Eomm Eomm added bug Confirmed bug good first issue Good for newcomers labels Jun 11, 2023
Uzlopak added a commit that referenced this issue Jun 23, 2023
Uzlopak added a commit that referenced this issue Jun 24, 2023
* fix timetree typo

* integrate pretty printing into avvio

* move time-tree into lib folder

* add test as issue #205 is also solved.

* add jsdoc, remove unreachable code

* use -1 as diff default value
@Fdawgs
Copy link
Member

Fdawgs commented Jun 24, 2023

Closed by #211

@Fdawgs Fdawgs closed this as completed Jun 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bug good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants