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

Bubbleprof: TypeError: Cannot read properties of undefined (reading 'name') at MarkModuleAggregateNodes._transform #473

Open
MaitreGEEK opened this issue Jul 7, 2024 · 2 comments

Comments

@MaitreGEEK
Copy link

Expected Behavior

Well the data should be showing off. but it's not caused by an issue

Current Behavior

  • Analysing datanode:events:495
    throw er; // Unhandled 'error' event
    ^

TypeError: Cannot read properties of undefined (reading 'name')
at MarkModuleAggregateNodes._transform (C:\Users\user\AppData\Roaming\nvm\v18.20.3\node_modules\clinic\node_modules@clinic\bubbleprof\analysis\aggregate\mark-module-aggregate-nodes.js:21:45)
at Transform._write (node:internal/streams/transform:175:8)
at writeOrBuffer (node:internal/streams/writable:392:12)
at _write (node:internal/streams/writable:333:10)
at Writable.write (node:internal/streams/writable:337:10)
at MarkPartyAggregateNodes.ondata (node:internal/streams/readable:809:22)
at MarkPartyAggregateNodes.emit (node:events:517:28)
at addChunk (node:internal/streams/readable:368:12)
at readableAddChunk (node:internal/streams/readable:341:9)
at Readable.push (node:internal/streams/readable:278:10)
Emitted 'error' event on CombineAsAggregateNodes instance at:
at CombineAsAggregateNodes.onerror (node:internal/streams/readable:828:14)
at CombineAsAggregateNodes.emit (node:events:517:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

Node.js v18.20.3

Steps to Reproduce (for bugs)

  1. Use Bubbleprof in Node >=18 versions.

Sample upload

Environment

  • Clinic.js version: v13.0.0
  • Node.js version: 20.12.0 and 18.20.3
  • Browser name and version: Chrome
  • Operating system and version: Windows 11 23H2
@MaitreGEEK MaitreGEEK changed the title TypeError: Cannot read properties of undefined (reading 'name') at MarkModuleAggregateNodes._transform Bubbleprof: TypeError: Cannot read properties of undefined (reading 'name') at MarkModuleAggregateNodes._transform Jul 7, 2024
@ptrjeffrey
Copy link

have the same problem

TypeError: Cannot read properties of undefined (reading 'name')
    at MarkModuleAggregateNodes._transform (d:\nvm\v16.18.1\node_modules\clinic\node_modules\@clinic\bubbleprof\analysis\aggregate\mark-module-aggregate-nodes.js:21:45)
    at MarkModuleAggregateNodes.Transform._write (node:internal/streams/transform:205:23)
    at writeOrBuffer (node:internal/streams/writable:391:12)
    at _write (node:internal/streams/writable:332:10)
    at MarkModuleAggregateNodes.Writable.write (node:internal/streams/writable:336:10)
    at MarkPartyAggregateNodes.ondata (node:internal/streams/readable:754:22)
    at MarkPartyAggregateNodes.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at MarkPartyAggregateNodes.Readable.push (node:internal/streams/readable:228:10)
  • clinic.js : v13.0.0
  • Nodejs version: 16.18.1
  • Browser name and version: Chrome
  • Operating system and version: Windows 11 23H2

@ptrjeffrey
Copy link

I temporary fixed it with the below code with modify the file (d:\nvm\v16.18.1\node_modules\clinic\node_modules@clinic\bubbleprof\analysis\aggregate\mark-module-aggregate-nodes.js:21:45)

'use strict'
const stream = require('stream')

class MarkModuleAggregateNodes extends stream.Transform {
  constructor (systemInfo) {
    super({
      readableObjectMode: true,
      writableObjectMode: true
    })

    this.systemInfo = systemInfo
  }

  _transform (aggregateNode, encoding, done) {
    if (aggregateNode.mark.get(0) === 'external') {
      const firstModule = aggregateNode.frames
        .filter((frame) => !frame.isNodecore(this.systemInfo))
        .map((frame) => frame.getModuleName(this.systemInfo))
        .pop()
      // if exist fistModule
      if (firstModule) {  
        aggregateNode.mark.set(1, firstModule.name ? firstModule.name : 'unknown')
      }else {
        aggregateNode.mark.set(1, 'unknown')
      }
    }

    done(null, aggregateNode)
  }
}

module.exports = MarkModuleAggregateNodes

modify the below js file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants