Cell runs forever when using interactive.csharp.getVariable in conjunction with console.log in a javascript cell
See original GitHub issueDescribe the bug
Creating the following .dib file and executing the cells (usually) causes the second cell to run indefinitely:
#!csharp
int i = 1234;
#!javascript
let x = 0
interactive.csharp.getVariable('i').then(v => console.log(v))
console.log(x)
.NET Interactive Version
Neither #!about
or dotnet interactive --version
seemed to work for me, but the vscode extension says it’s the following version: v1.0.2309030
- OS
- Windows 11
- Windows 10
- macOS
- Linux (Please specify distro)
- iOS
- Android
- Browser
- Chrome
- Edge
- Firefox
- Safari
- Frontend
- Jupyter Notebook
- Jupyter Lab
- nteract
- Visual Studio Code
- Visual Studio Code Insiders
- Other (please specify)
Screenshots
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7 (5 by maintainers)
Top Results From Across the Web
`interactive.csharp` object is undefined · Issue #1803
csharp object is always coming back as undefined. I tried the simple instructions from the readme about sharing variables with javascript (see ...
Read more >Every time I click the tables cell I want to console.log ...
I am confused how do I return the value of multidimensional array? every time I click the tables cell I want to console.log...
Read more >Displaying HTML with values from variables in the dotnet ...
1) Using the HTML and JS kernels. In this first example we must create the variable and assign it a value in a...
Read more >The 10 Most Common Mistakes in C# Programming
Common C# Programming Mistake #1: Using a reference like a value or vice versa. Programmers of C++, and many other languages, are accustomed...
Read more >Untitled
Angry bird game download java mobile, Alabama rammer yammer ringtone ... but up book online, Paco ignacio taibo ii pdf gratis, 5amsa w...
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 FreeTop 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
Top GitHub Comments
Closing this.
interactive.csharp.getVariable
has been removed as#!share
is now supported in JavaScript kernels.The example code has a race condition. If the cell execution completes before the promise is fulfilled, you’ll only get the
0
output, which is by design. This is what I see most of the time. Occasionally though (and presumably more often on some hardware) it does either print both outputs and complete or run forever.If I await the promise, I see both outputs 100% of the time, and can’t reproduce the endlessly-running cell. This suggests to me that the race condition is the reason the cell execution doesn’t complete, which would be a bug in our JavaScript evaluation code in the VS Code extension. @RandomFractals or @Treit, do you see the same when running this:
@brettfo?