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.

[Bug] Variable uncovering returns "undefined" for nested variables

See original GitHub issue
  • Insomnia Version: 6.2.3
  • Operating System: Linux Mint

Details

https://github.com/getinsomnia/insomnia/pull/1274 introduces variable uncovering (helpful), but it seems that nested variable references returns {undefined}:<variable>

For example use the following environment:

{
  "foo": {
    "bar": "foobar"
  },
  "fu": {
    "baz": "{{ foo.bar  }}"
  },
  "foobar": "foobar2",
  "fubaz": "{{foobar}}"
}
  • Hover over the fu.baz value ( {{ foo.bar }} ), and notice it shows {undefined}:foobar
  • Hover over the fubaz value ( {{ foobar }} ), and notice it shows {root}:foobar2

Expectations:

  • Hovering over the value shows {{root}}:foobar like a non-nested value does.

Other thoughts:

  • Should the root reference instead say “Base Environment” to correspond to the Base Environment?

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
dhruv944commented, Dec 5, 2018

Thanks for reporting this. I’ll pick it up ASAP.

0reactions
Gabrzcommented, Aug 12, 2019

I first thought a fix could be done in the nunjucks-tags.js but that was not the case.

I’ve now added a recursive function that fetches all the nested keys, in the render.js.

https://github.com/Gabrz/insomnia/blob/52eb9be65d7b8f0d6a8704a94d6b51d2661aeb16/packages/insomnia-app/app/common/render.js#L240-L272

I’ve created a Pull Request #1637, but it failed during the CIT AppVeyor, not sure why tho. I have no errors in my insomnia development environment and the change seems to be working.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Bug] Variable uncovering returns "undefined" for nested ...
Expectations: Hovering over the value shows {{root}}:foobar like a non-nested value does. Other thoughts: Should the root reference instead say ...
Read more >
nested functions returning undefined - Stack Overflow
hi I want to get the result of this function at once inside the items variable, but when I try to return items...
Read more >
Recursive function returning undefined - Sololearn
I have a recursive function for returning nested objects. ... I assign it to a variable and then call the variable it returns...
Read more >
Learning JavaScript functions and how you should use them
We do that with return values and the return statement. All JavaScript function calls evaluate to a value. By default, that value is...
Read more >
Reactivity Fundamentals - Vue.js
These instance properties are only added when the instance is first created, so you need to ensure they are all present in the...
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