# Error only while using debugger in VSCode

**URL:** <https://discourse.julialang.org/t/error-only-while-using-debugger-in-vscode/101707>\
**Category:** VS Code\
**Created:** [July 17, 2023, 7:54pm UTC](https://discourse.julialang.org/t/error-only-while-using-debugger-in-vscode/101707 "2023-07-17T19:54:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sophia\_Wright](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sophia_wright/32/51611_2.png) [@Sophia\_Wright](https://discourse.julialang.org/u/Sophia_Wright)\
**Post date:** [July 17, 2023, 7:54pm UTC](https://discourse.julialang.org/t/error-only-while-using-debugger-in-vscode/101707/1 "2023-07-17T19:54:27Z")

</div>

Hello - I’m unable to use the debugger in VSCode while using the KernelAbstractions.jl library. I have shared details along with a minimal reproducer here:

> <https://github.com/JuliaGPU/KernelAbstractions.jl/issues/405>
>
> hello - I'm able to run a script based on an Oceananigans example in VSCode, but… get an error while using the VSCode debugger on the same script that runs fine. I've shared details incl screenshots and code here:
> 
> https://github.com/CliMA/Oceananigans.jl/issues/3171
> 
> It looks like the error has something to do with the usage of KernelAbstractions - one of the authors of the Oceananigans library has added a comment in the issue above
> 
> specifically, this line of code leads to the error:
> 
> https://github.com/JuliaGPU/KernelAbstractions.jl/blob/main/src/cpu.jl#L44
> 
> it'd be very helpful if someone who has run any KernelAbstractions code with VSCode could please share some feedback to help us resolve the issue.
> 
> I've also opened an issue on the julia-vscode extension github repo here:
> 
> https://github.com/julia-vscode/julia-vscode/issues/3349
> 
> thank you

> <https://github.com/julia-vscode/julia-vscode/issues/3349>
>
> Hello - I'm able to run a Julia script in VSCode, but when I set breakpoints and… run in Debug mode, the same code throws an exception.
> 
> I have described the issue in detail with screenshots and the exact error here:
> 
> https://github.com/CliMA/Oceananigans.jl/issues/3171
> 
> the issue is due to some functions returning the value of variables (boundary condition values more specifically) as \`nothing\` , which is not an error, and as I mentioned before, when I run the script, it runs fine.
> 
> I hope the thread in the linked issue provides more information.
> 
> I'd greatly appreciate any help figuring out how to resolve this issue so I can use the debugger. Thank you!

essentially - I’m able to run the script fine in VS Code, but I only get the errors shown in the screenshots in the issues when I set breakpoints and step through the code

I’d greatly appreciate any help - thank you!

---

<div class="post-metadata">

**Author:** ![Zentrik](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zentrik/32/35409_2.png) [@Zentrik](https://discourse.julialang.org/u/Zentrik)\
**Post date:** [July 18, 2023, 10:21pm UTC](https://discourse.julialang.org/t/error-only-while-using-debugger-in-vscode/101707/2 "2023-07-18T22:21:14Z")

</div>

You could try using Debugger.jl instead, I believe it’s separate from the VsCode debugger so it might work.

---

<div class="post-metadata">

**Author:** ![Sophia\_Wright](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sophia_wright/32/51611_2.png) [@Sophia\_Wright](https://discourse.julialang.org/u/Sophia_Wright)\
**Post date:** [July 18, 2023, 11:28pm UTC](https://discourse.julialang.org/t/error-only-while-using-debugger-in-vscode/101707/3 "2023-07-18T23:28:06Z")

</div>

thank you for replying - I looked at Debugger.jl and will def try that - I’m used to the VSCode debugger and would like to inspect the code and values of variables as I step through the code of a library without modifying it - I’ll look into some more

I’d be super grateful if someone could try out the reproducer - I think quite a few folks would find the VSCode debugger helpful

thank you again!
