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.

"Cannot read property 'then' of null" since 7.14.0

See original GitHub issue

💥 Regression Report

Since 7.14.0, we’re seing Cannot read property 'then' of null errors in @elastic/elasticsearch/lib/Transport.js:167:18 .

May be related with #1516 ? (errors are both nullrefs, but not thrown from the same place)

Last working version

Worked up to version: 7.13.0

(fyi we mistakenly did not pin elasticsearch package minor version in our build pipeline, and we’ve seen that regression in prod, so i’m pretty sure that it has been OK with every version <= 7.13.0 for the past ~2 years)

Stopped working in version: 7.14.0

To Reproduce

I’m not sure… I dont have tried to reproduce it locally. But call .search() ? (that is the only thing that our code does, and our prod logs suggest that it was failing systematically)

[edit] See snipped here to reproduce

Expected behavior

No errors 😃

Your Environment

Elastic Beanstalk running Node 10 (everything is else default)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
delvedorcommented, Oct 29, 2021

Closed in #1594.

1reaction
oguimbalcommented, Aug 20, 2021

That is arguable, in my opinion.

When using a callback philosophy, you are implicitely asked to call the given callback. But it is not supposed to be mandatory to return something. Else, you are effectively forcing the use of promises, and then I dont see the point of passing a callback as an argument of request().

Anyway, that is how the lib we use (30k weekly downloads) is doing things, and it was working fine until 7.14.0.

Since this was working before, this looked like a regression to me 😃

Moreover, the incriminated code I linked looked sufficiently smelly to me to think that something was going on here. Thus, I felt compeled to report this.

That is kind of a sterile debate, but if your lib supports what you consider to be buggy implementations, then I think most people will expect it to keep supporting them in following minor versions.

That said, I’m perfectly happy to be stuck with 7.13.0, my point was only to warn you that this version had potential breaking changes 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Cannot read property 'value' of null" while linting #13394
But we discovered this error through a GitHub action (same error as above). We then tested by downloading the repo and putting it...
Read more >
Uncaught TypeError: Cannot read property of null - iDiallo
All this means is that you are trying to access a property of an object that is undefined. These usually happens when we...
Read more >
Uncaught TypeError: Cannot read property 'value' of null
If in your HTML you have an input element with a name or id with a _ like e.g. first_name or more than...
Read more >
Release notes | Elasticsearch JavaScript Client [7.17]
Fixed "Cannot read property then of null" #1594edit ... Show the body as string if the response error can't be read as ES...
Read more >
error cannot read properties of undefined ...
Re-run the command with --logging for more information. I created numerous blank projects and installed each one individually. Clean the node_modules and then...
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