[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.bazvalue ({{ foo.bar }}), and notice it shows{undefined}:foobar - Hover over the
fubazvalue ({{ foobar }}), and notice it shows{root}:foobar2
Expectations:
- Hovering over the value shows
{{root}}:foobarlike a non-nested value does.
Other thoughts:
- Should the
rootreference instead say “Base Environment” to correspond to the Base Environment?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (5 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Thanks for reporting this. I’ll pick it up ASAP.
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.