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.

JavaScript does not work; the kernel or host throws a null reference exception

See original GitHub issue

Describe the bug

I installed the extension in Visual Studio Code Insiders and I am not able to run a JavaScript interactive cell. Cell test contents:

console.log('test')

Exception copied below.

Please complete the following:

Which version of .NET Interactive are you using? Version: 1.0.132609+29c04d2c9fbbf3b6975d8e76d2abd62097db285b Build date: 2020-06-27T12:53:18.3665518Z

  • OS
    • Windows 10
    • macOS
    • Linux (Please specify distro)
    • iOS
    • Android
  • Browser
    • Chrome
    • Edge
    • Firefox
    • Safari
  • Frontend
    • Jupyter Notebook
    • Jupyter Lab
    • nteract
    • Visual Studio Code
    • Other (please specify)

Exception

Error: System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.DotNet.Interactive.App.CommandLine.CommandLineParser.<>c__DisplayClass7_0.<SetUpFormatters>b__2(ScriptContent script, TextWriter writer) in F:\workspace\_work\1\s\src\dotnet-interactive\CommandLine\CommandLineParser.cs:line 529
at Microsoft.DotNet.Interactive.Formatting.AnonymousTypeFormatter`1.Format(T instance, TextWriter writer) in F:\workspace\_work\1\s\src\Microsoft.DotNet.Interactive.Formatting\AnonymousTypeFormatter{T}.cs:line 27
at Microsoft.DotNet.Interactive.Formatting.TypeFormatter`1.Microsoft.DotNet.Interactive.Formatting.ITypeFormatter.Format(Object instance, TextWriter writer) in F:\workspace\_work\1\s\src\Microsoft.DotNet.Interactive.Formatting\TypeFormatter{T}.cs:line 19
at Microsoft.DotNet.Interactive.Formatting.Formatter`1.FormatTo(T obj, TextWriter writer, String mimeType) in F:\workspace\_work\1\s\src\Microsoft.DotNet.Interactive.Formatting\Formatter{T}.cs:line 93
at Microsoft.DotNet.Interactive.Formatting.Formatter.FormatTo[T](T obj, TextWriter writer, String mimeType) in F:\workspace\_work\1\s\src\Microsoft.DotNet.Interactive.Formatting\Formatter.cs:line 278
at Microsoft.DotNet.Interactive.Formatting.Formatter.ToDisplayString(Object obj, String mimeType) in F:\workspace\_work\1\s\src\Microsoft.DotNet.Interactive.Formatting\Formatter.cs:line 242
at Microsoft.DotNet.Interactive.KernelInvocationContextExtensions.Display(KernelInvocationContext context, Object value, String mimeType) in F:\workspace\_work\1\s\src\Microsoft.DotNet.Interactive\KernelInvocationContextExtensions.cs:line 33
at Microsoft.DotNet.Interactive.KernelInvocationContextExtensions.DisplayAsync(KernelInvocationContext context, Object value, String mimeType) in F:\workspace\_work\1\s\src\Microsoft.DotNet.Interactive\KernelInvocationContextExtensions.cs:line 20
at Microsoft.DotNet.Interactive.JavaScriptKernel.HandleAsync(SubmitCode command, KernelInvocationContext context) in F:\workspace\_work\1\s\src\Microsoft.DotNet.Interactive\JavaScriptKernel.cs:line 24
at Microsoft.DotNet.Interactive.Commands.KernelCommand.InvokeAsync(KernelInvocationContext context) in F:\workspace\_work\1\s\src\Microsoft.DotNet.Interactive\Commands\KernelCommand.cs:line 48
at Microsoft.DotNet.Interactive.Kernel.HandleAsync(KernelCommand command, KernelInvocationContext context) in F:\workspace\_work\1\s\src\Microsoft.DotNet.Interactive\Kernel.cs:line 293
at Microsoft.DotNet.Interactive.KernelCommandPipeline.<BuildPipeline>b__6_0(KernelCommand command, KernelInvocationContext context, KernelPipelineContinuation _) in F:\workspace\_work\1\s\src\Microsoft.DotNet.Interactive\KernelCommandPipeline.cs:line 56
at Microsoft.DotNet.Interactive.KernelCommandPipeline.<>c__DisplayClass6_1.<<BuildPipeline>b__3>d.MoveNext() in F:\workspace\_work\1\s\src\Microsoft.DotNet.Interactive\KernelCommandPipeline.cs:line 74
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.DotNet.Interactive.CompositeKernel.LoadExtensions(KernelCommand command, KernelInvocationContext context, KernelPipelineContinuation next) in F:\workspace\_work\1\s\src\Microsoft.DotNet.Interactive\CompositeKernel.cs:line 119
at Microsoft.DotNet.Interactive.KernelCommandPipeline.<>c__DisplayClass6_1.<<BuildPipeline>b__3>d.MoveNext() in F:\workspace\_work\1\s\src\Microsoft.DotNet.Interactive\KernelCommandPipeline.cs:line 74
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.DotNet.Interactive.Kernel.<AddDirectiveMiddlewareAndCommonCommandHandlers>b__21_0(KernelCommand originalCommand, KernelInvocationContext context, KernelPipelineContinuation next) in F:\workspace\_work\1\s\src\Microsoft.DotNet.Interactive\Kernel.cs:line 125
at Microsoft.DotNet.Interactive.KernelCommandPipeline.<>c__DisplayClass6_1.<<BuildPipeline>b__3>d.MoveNext() in F:\workspace\_work\1\s\src\Microsoft.DotNet.Interactive\KernelCommandPipeline.cs:line 74
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.DotNet.Interactive.Kernel.SetKernel(KernelCommand command, KernelInvocationContext context, KernelPipelineContinuation next) in F:\workspace\_work\1\s\src\Microsoft.DotNet.Interactive\Kernel.cs:line 221
at Microsoft.DotNet.Interactive.KernelCommandPipeline.<>c__DisplayClass6_1.<<BuildPipeline>b__3>d.MoveNext() in F:\workspace\_work\1\s\src\Microsoft.DotNet.Interactive\KernelCommandPipeline.cs:line 74
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.DotNet.Interactive.Kernel.<>c.<<AddCaptureConsoleMiddleware>b__20_0>d.MoveNext() in F:\workspace\_work\1\s\src\Microsoft.DotNet.Interactive\Kernel.cs:line 100
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.DotNet.Interactive.KernelCommandPipeline.<>c__DisplayClass6_0.<<BuildPipeline>g__Combine|2>d.MoveNext() in F:\workspace\_work\1\s\src\Microsoft.DotNet.Interactive\KernelCommandPipeline.cs:line 75
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.DotNet.Interactive.KernelCommandPipeline.<>c__DisplayClass6_0.<<BuildPipeline>g__Combine|2>d.MoveNext() in F:\workspace\_work\1\s\src\Microsoft.DotNet.Interactive\KernelCommandPipeline.cs:line 75
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.DotNet.Interactive.KernelCommandPipeline.<>c__DisplayClass6_0.<<BuildPipeline>g__Combine|2>d.MoveNext() in F:\workspace\_work\1\s\src\Microsoft.DotNet.Interactive\KernelCommandPipeline.cs:line 75
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.DotNet.Interactive.KernelCommandPipeline.<>c__DisplayClass6_0.<<BuildPipeline>g__Combine|2>d.MoveNext() in F:\workspace\_work\1\s\src\Microsoft.DotNet.Interactive\KernelCommandPipeline.cs:line 75
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.DotNet.Interactive.KernelCommandPipeline.SendAsync(KernelCommand command, KernelInvocationContext context) in F:\workspace\_work\1\s\src\Microsoft.DotNet.Interactive\KernelCommandPipeline.cs:line 48

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jonsequiturcommented, Jun 29, 2020

Also note that you can put both of these into a single cell so that the JavaScript output appears in a more intuitive location:

image

0reactions
cveldcommented, Jun 29, 2020

A small example to work with:

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - Null Reference Exception is thrown sometimes
Null Reference Exception is thrown sometimes ... Based on screen resolution iam setting a login web page. How do I avoid null reference...
Read more >
Why are null references shunned while throwing ...
A Null reference usually occurs because something in the program logic was missed, ie: you got to a line of code without going...
Read more >
Null Reference Exceptions
NullReferenceException happens when your script code tries to use a variable which isn't set (referencing) and object. The error message that appears tells...
Read more >
Deployment Error Configuration Failed | Apigee Edge
Deployment of API proxy or Shared Flow revisions through the Edge UI or management API fails with a Configuration failed error.
Read more >
Troubleshoot Cloud Run issues
This page shows you how to resolve issues with Cloud Run. For other issues not listed below, check to see if they may...
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