Skip to content
This repository was archived by the owner on Apr 27, 2026. It is now read-only.
This repository was archived by the owner on Apr 27, 2026. It is now read-only.

JavaScript variables are not being registered outside of cells #2928

Description

@IntegerMan

Describe the bug

Apologies if this is a misunderstanding of kernel limitations.

I can import a C# variable into JavaScript without issues. However, if I declare a JS variable in a JS cell using either let or const, that variable does not seem to be registered in the variables section, is not available in the next cell (even if it's a JS cell), does not share correctly to C# or other kernels, and perhaps most interestingly, doesn't log out at the end of the same cell it was defined in if it was the closing value as in:

let jsVar = 42;
jsVar; // jsVar is not displayed after the cell

JavaScript otherwise appears to function just fine, but variable persistence and sharing just isn't working for me.

See https://github.com/IntegerMan/PolyglotNotebookTalk/blob/main/cs_js.dib for my sample notebook.

Please complete the following:

Which version of .NET Interactive are you using? (In a notebook, run the #!about magic command. ):

  • 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
    • Visual Studio
    • Other (please specify)

Screenshots

image

Metadata

Metadata

Assignees

Labels

Area-DocumentationImprovements or additions to documentationbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions