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.

asyncFilter is undefined

See original GitHub issue

Environment data

VS Code version: 1.56.2

  • Extension version (available under the Extensions sidebar): 2021.5.842923320
  • OS and version: macOS 10.15.7,
  • Python version (& distribution if applicable, e.g. Anaconda): 2.7.16, 3.8.2
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): N/A
  • Relevant/affected Python packages and their versions: XXX
  • Relevant/affected Python-related VS Code extensions and their versions: LaunchDarkly Beta 2021.5.1621341594
  • Value of the python.languageServer setting: XXX

[NOTE: If you suspect that your issue is related to the Microsoft Python Language Server (python.languageServer: 'Microsoft'), please download our new language server Pylance from the VS Code marketplace to see if that fixes your issue]

Expected behaviour

Extensions running normally

Actual behaviour

With the LaunchDarkly Beta Extension and Python extension installed and actived this is spamming the logs. I have traced the issue from LaunchDarkly code through to Node github repo and asyncFilter is not in any of them. Then found in the Python extenion you are extending the Array protoype: https://github.com/microsoft/vscode-python/blob/main/src/client/common/extensions.ts#L54-L60 not having console log spamming:

I  ERR Cannot read property 'asyncFilter' of undefined: TypeError: Cannot read property 'asyncFilter' of undefined
    at computeDependencies (/Users/danielobrien/.vscode/extensions/launchdarklyofficial.launchdarkly-beta-2022.1.2/node_modules/launchdarkly-node-server-sdk/feature_store_event_wrapper.js:147:31)
    at cb (/Users/danielobrien/.vscode/extensions/launchdarklyofficial.launchdarkly-beta-2022.1.2/node_modules/launchdarkly-node-server-sdk/feature_store_event_wrapper.js:176:72)
    at callbackResult (/Users/danielobrien/.vscode/extensions/launchdarklyofficial.launchdarkly-beta-2022.1.2/node_modules/launchdarkly-node-server-sdk/feature_store.js:27:11)
    at Object.init (/Users/danielobrien/.vscode/extensions/launchdarklyofficial.launchdarkly-beta-2022.1.2/node_modules/launchdarkly-node-server-sdk/feature_store.js:64:5)
    at doInit (/Users/danielobrien/.vscode/extensions/launchdarklyofficial.launchdarkly-beta-2022.1.2/node_modules/launchdarkly-node-server-sdk/feature_store_event_wrapper.js:168:22)
    at Object.init (/Users/danielobrien/.vscode/extensions/launchdarklyofficial.launchdarkly-beta-2022.1.2/node_modules/launchdarkly-node-server-sdk/feature_store_event_wrapper.js:213:9)
    at f.<anonymous> (/Users/danielobrien/.vscode/extensions/launchdarklyofficial.launchdarkly-beta-2022.1.2/node_modules/launchdarkly-node-server-sdk/streaming.js:112:22)
    at f.emit (events.js:315:20)
    at _emit (/Users/danielobrien/.vscode/extensions/launchdarklyofficial.launchdarkly-beta-2022.1.2/node_modules/launchdarkly-eventsource/lib/eventsource.js:309:12)
    at receivedEvent (/Users/danielobrien/.vscode/extensions/launchdarklyofficial.launchdarkly-beta-2022.1.2/node_modules/launchdarkly-eventsource/lib/eventsource.js:323:5)
    at parseEventStreamLine (/Users/danielobrien/.vscode/extensions/launchdarklyofficial.launchdarkly-beta-2022.1.2/node_modules/launchdarkly-eventsource/lib/eventsource.js:336:9)
    at IncomingMessage.<anonymous> (/Users/danielobrien/.vscode/extensions/launchdarklyofficial.launchdarkly-beta-2022.1.2/node_modules/launchdarkly-eventsource/lib/eventsource.js:271:11)
    at IncomingMessage.emit (events.js:315:20)
    at addChunk (internal/streams/readable.js:309:12)
    at readableAddChunk (internal/streams/readable.js:284:9)
    at IncomingMessage.Readable.push (internal/streams/readable.js:223:10)
    at HTTPParser.parserOnBody (_http_common.js:139:24)
    at TLSSocket.socketOnData (_http_client.js:509:22)
    at TLSSocket.emit (events.js:315:20)
    at addChunk (internal/streams/readable.js:309:12)
    at readableAddChunk (internal/streams/readable.js:284:9)
    at TLSSocket.Readable.push (internal/streams/readable.js:223:10)
    at TLSWrap.onStreamRead (internal/stream_base_commons.js:188:23)```

## Steps to reproduce:

[**NOTE**: Self-contained, minimal reproducing code samples are **extremely** helpful and will expedite addressing your issue]

1. Have LaunchDarkly Beta extension installed and configured and Python extension. Open a repo like this one https://github.com/launchdarkly/SupportService and the logs will spam about asyncFilter. It causes the Treeview contributed by LaunchDarkly not to work


Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
karrtikrcommented, Jun 8, 2021

It might be doing it in an indirect way, for eg. it could be fetching all Array.prototype properties and then doing something and mentioning the asyncFilter property itself.

The error comes from /Users/danielobrien/.vscode/extensions/launchdarklyofficial.launchdarkly-beta-2022.1.2/node_modules/launchdarkly-node-server-sdk/feature_store_event_wrapper.js:147:31, which I think is here, you’ll need to check that.

I don’t think we should be responsible for having to prove it’s the Python Extension directly by building it without that prototype extension.

I understand remove the prototype on our behalf will fix the issue, but that doesn’t mean that it’s the extension which is causing the issue. Us extending a prototype that is unique in name should not cause a problem with other extensions.

1reaction
InTheCloudDancommented, Jun 8, 2021

@karrtikr nowhere in node-server-sdk all the way to node repo on github is using asyncFilter. I’ve search its code base and its dependencies. If the Python Extension is disabled this error goes away.

Why does the extension need to extend the prototype when that can have knock-on effects on other plugins? I don’t think we should be responsible for having to prove it’s the Python Extension directly by building it without that prototype extension.

Read more comments on GitHub >

github_iconTop Results From Across the Web

node async library filterLimit always returns undefined
I'm trying to async filter a list of file paths to return only existing files. I'm using the async library's filterLimit along with...
Read more >
node async library filterLimit always returns undefined-node.js
[Solved]-node async library filterLimit always returns undefined-node.js. Search. score:1. Accepted answer ... const asyncFilter = require('async').
Read more >
Observable<number> evaluates undefined on 0 · Issue #3 ... - GitHub
When using async filter on observable, value is evaluated to undefined instead of 0. I'm using async to bind length of array to...
Read more >
Async/Await and JavaScript Arrays - Comtravo Tech
With an imaginary asyncFilter that supports async/await we can make ... return undefined; } // You can use as follows const array =...
Read more >
QTable - error when i use async filter-method - Quasar forum
Hey, is it possible to set filter-method async? I am getting error “undefined p.” and it's happens only if filter-method is set to...
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