question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: Cannot read property 'includes' of undefined

See original GitHub issue

Node Version - 8.5.0

  1. Getting this TypeError when I am running this not sure how and why…?
  2. Could you provide some usage examples?
  3. Any specific reason as to why the default threshold is set at 20ms?

Code Implementation

let result = [];

blocked((time, stack) => {
  result = result.concat(stack);
  console.log('engine.js blocked', time, stack);
}, { threshold: 20 });

Below is my log when I start my app.

engine.js blocked 23.87353503417969 [ '    at process.nextTick (internal/process/next_tick.js:270:7)',
  '    at handleOperationCallback (/home/deploy/apps/syook-tnt-server/node_modules/mongodb-core/lib/connection/pool.js:468:24)',
  '    at /home/deploy/apps/syook-tnt-server/node_modules/mongodb-core/lib/connection/pool.js:504:9',
  '    at authenticateStragglers (/home/deploy/apps/syook-tnt-server/node_modules/mongodb-core/lib/connection/pool.js:443:16)',
  '    at Connection.messageHandler (/home/deploy/apps/syook-tnt-server/node_modules/mongodb-core/lib/connection/pool.js:477:5)',
  '    at Socket.<anonymous> (/home/deploy/apps/syook-tnt-server/node_modules/mongodb-core/lib/connection/connection.js:331:22)',
  '    at emitOne (events.js:115:13)',
  '    at Socket.emit (events.js:210:7)',
  '    at addChunk (_stream_readable.js:266:12)',
  '    at readableAddChunk (_stream_readable.js:253:11)',
  '    at Socket.Readable.push (_stream_readable.js:211:10)',
  '    at TCP.onread (net.js:585:20)' ]
engine.js blocked 24.23693408203125 [ '    at process.nextTick (internal/process/next_tick.js:270:7)',
  '    at handleOperationCallback (/home/deploy/apps/syook-tnt-server/node_modules/mongodb-core/lib/connection/pool.js:468:24)',
  '    at /home/deploy/apps/syook-tnt-server/node_modules/mongodb-core/lib/connection/pool.js:504:9',
  '    at authenticateStragglers (/home/deploy/apps/syook-tnt-server/node_modules/mongodb-core/lib/connection/pool.js:443:16)',
  '    at Connection.messageHandler (/home/deploy/apps/syook-tnt-server/node_modules/mongodb-core/lib/connection/pool.js:477:5)',
  '    at Socket.<anonymous> (/home/deploy/apps/syook-tnt-server/node_modules/mongodb-core/lib/connection/connection.js:331:22)',
  '    at emitOne (events.js:115:13)',
  '    at Socket.emit (events.js:210:7)',
  '    at addChunk (_stream_readable.js:266:12)',
  '    at readableAddChunk (_stream_readable.js:253:11)',
  '    at Socket.Readable.push (_stream_readable.js:211:10)',
  '    at TCP.onread (net.js:585:20)' ]
engine.js blocked 24.492054931640624 [ '    at internalConnect (net.js:939:26)',
  '    at GetAddrInfoReqWrap.emitLookup [as callback] (net.js:1098:7)',
  '    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:98:10)' ]
engine.js blocked 24.613239013671876 [ '    at internalConnect (net.js:939:26)',
  '    at GetAddrInfoReqWrap.emitLookup [as callback] (net.js:1098:7)',
  '    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:98:10)' ]
setTCPConnection true
new client connection from ::ffff:43.228.229.58:38268
connection data from ::ffff:43.228.229.58:38268: "|2017-09-23 16:09:40,D4:22:01:00:03:FD,01,001,00,-69,100,|2017-09-23 16:09:40,D4:22:01:00:03:F7,01,003,00,-88,100,|2017-09-23 16:09:40,D4:22:01:00:03:F3,02,001,00,-98,100,003,00,-88,100,|2017-09-23 16:09:40,D4:22:01:00:03:FC,02,001,00,-78,100,003,00,-94,100,|2017-09-23 16:09:40,D4:22:01:00:03:F2,01,003,00,-70,100,|2017-09-23 16:09:40,D4:22:01:00:03:F4,02,001,00,-89,100,003,00,-88,100,|2017-09-23 16:09:40,D4:22:01:00:03:F6,02,001,00,-87,100,003,00,-88,100,|2017-09-23 16:09:40,D4:22:01:00:03:FF,01,001,00,-47,100,|2017-09-23 16:09:40,D4:22:01:00:03:EB,01,001,00,-49,100,|2017-09-23 16:09:40,D4:22:01:00:03:EA,01,001,00,-58,100,|2017-09-23 16:09:40,D4:22:01:00:03:FA,01,001,00,-64,100,|2017-09-23 16:09:40,D4:22:01:00:03:E9,01,001,00,-49,100,|2017-09-23 16:09:40,D4:22:01:00:03:ED,01,001,00,-79,100,|2017-09-23 16:09:40,D4:22:01:00:03:EE,01,001,00,-79,100,|2017-09-23 16:09:40,D4:22:01:00:03:F9,01,001,00,-58,100,|2017-09-23 16:09:40,D4:22:01:00:04:00,01,001,00,-77,100,|2017-09-23 16:09:40,D4:22:01:00:03:F0,01,001,00,-59,100,"
data contains gatewayHandshakeMsg false
mode =  IDLE
info: [Stream Log] D4:22:01:00:03:FD reader pings 001 00 -69 100
info: [Stream Log] D4:22:01:00:03:F7 reader pings 003 00 -88 100
info: [Stream Log] D4:22:01:00:03:F3 reader pings 001 00 -98 100
info: [Stream Log] D4:22:01:00:03:F3 reader pings 003 00 -88 100
info: [Stream Log] D4:22:01:00:03:FC reader pings 001 00 -78 100
info: [Stream Log] D4:22:01:00:03:FC reader pings 003 00 -94 100
info: [Stream Log] D4:22:01:00:03:F2 reader pings 003 00 -70 100
info: [Stream Log] D4:22:01:00:03:F4 reader pings 001 00 -89 100
info: [Stream Log] D4:22:01:00:03:F4 reader pings 003 00 -88 100
info: [Stream Log] D4:22:01:00:03:F6 reader pings 001 00 -87 100
info: [Stream Log] D4:22:01:00:03:F6 reader pings 003 00 -88 100
info: [Stream Log] D4:22:01:00:03:FF reader pings 001 00 -47 100
info: [Stream Log] D4:22:01:00:03:EB reader pings 001 00 -49 100
info: [Stream Log] D4:22:01:00:03:EA reader pings 001 00 -58 100
info: [Stream Log] D4:22:01:00:03:FA reader pings 001 00 -64 100
info: [Stream Log] D4:22:01:00:03:E9 reader pings 001 00 -49 100
info: [Stream Log] D4:22:01:00:03:ED reader pings 001 00 -79 100
info: [Stream Log] D4:22:01:00:03:EE reader pings 001 00 -79 100
info: [Stream Log] D4:22:01:00:03:F9 reader pings 001 00 -58 100
info: [Stream Log] D4:22:01:00:04:00 reader pings 001 00 -77 100
info: [Stream Log] D4:22:01:00:03:F0 reader pings 001 00 -59 100
TypeError: Cannot read property 'includes' of undefined
    at cleanStack (/home/deploy/apps/syook-tnt-server/node_modules/blocked-at/index.js:9:38)
    at AsyncHook.after (/home/deploy/apps/syook-tnt-server/node_modules/blocked-at/index.js:42:28)
    at emitAfterNative (async_hooks.js:375:40)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
naugturcommented, Sep 25, 2017

I’ll release in a few hours.

The log you posted doesn’t have the stack I hoped for unfortunately.

If you’d be so kind and run it a few times until you get a debug with something that resembles a stacktrace, would be great. If you can’t reproduce the stacktrace, I’ll have to wait for the next case.

0reactions
naugturcommented, Sep 25, 2017

Fixed in v1.0.3

Read more comments on GitHub >

github_iconTop Results From Across the Web

JavaScript error: Cannot read property 'includes' of undefined
It's telling you that you're trying to access a property on an undefined object. The msgArr object doesn't have a property objectID at...
Read more >
Cannot read property 'includes' of undefined #1474 - GitHub
Hi, we use got in many microservice and yesterday we upgrade v11.5.2 to v11.7.0. Since this upgrade we have some error. RequestError: Cannot...
Read more >
Cannot read property 'includes' of undefined : r/learnjavascript
Problem: Uncaught TypeError: Cannot read property 'includes' of undefined. Hi there, I'm having an issue with my script. It shows this:.
Read more >
cannot read properties of undefined (reading 'includes'
If the element at index 0 contains the innerHTML property, our if block will run, otherwise the else block is run. To solve...
Read more >
Cannot Read Property of Undefined in JavaScript - Rollbar
The TypeError: Cannot read property of undefined is one of the most common type errors in JavaScript. It occurs when a property is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found