# VScode error: Cannot read property 'file' of undefined

**URL:** <https://discourse.julialang.org/t/vscode-error-cannot-read-property-file-of-undefined/71710>\
**Category:** Tooling\
**Tags:** vscode\
**Created:** [November 18, 2021, 9:20am UTC](https://discourse.julialang.org/t/vscode-error-cannot-read-property-file-of-undefined/71710 "2021-11-18T09:20:57Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sharon-Liang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sharon-liang/32/30918_2.png) [@Sharon-Liang](https://discourse.julialang.org/u/Sharon-Liang)\
**Post date:** [November 18, 2021, 9:20am UTC](https://discourse.julialang.org/t/vscode-error-cannot-read-property-file-of-undefined/71710/1 "2021-11-18T09:20:57Z")

</div>

Hi guys,  
I’m using VScode + julia extensions. Normally, when I apply ⇧(shift)+enter on a line of code in a .jl file, it will automatically open a julia REPL. However, today when I do the same thing, it reports an warning: _Cannot read property ‘file’ of undefined_ on the bottom right corner of the screen and nothing happens.

I have no idea what I did to cause this problem. How can I fix it?

---

<div class="post-metadata">

**Author:** ![logankilpatrick](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/logankilpatrick/32/38123_2.png) [@logankilpatrick](https://discourse.julialang.org/u/logankilpatrick)\
**Post date:** [November 19, 2021, 4:54am UTC](https://discourse.julialang.org/t/vscode-error-cannot-read-property-file-of-undefined/71710/2 "2021-11-19T04:54:31Z")

</div>

Can you add a screenshot ? Also, does this persist after closing and re-opening VSCode?

---

<div class="post-metadata">

**Author:** ![Jovan\_Babic](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jovan_babic/32/31072_2.png) [@Jovan\_Babic](https://discourse.julialang.org/u/Jovan_Babic)\
**Post date:** [November 24, 2021, 2:22pm UTC](https://discourse.julialang.org/t/vscode-error-cannot-read-property-file-of-undefined/71710/3 "2021-11-24T14:22:41Z")

</div>

I am having same problem.Here is the screenshot.

> **[Screenshot](https://prnt.sc/20sep9h)**
>
> Captured with Lightshot

---

<div class="post-metadata">

**Author:** ![hdavid16](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hdavid16/32/11531_2.png) [@hdavid16](https://discourse.julialang.org/u/hdavid16)\
**Post date:** [December 10, 2021, 4:34am UTC](https://discourse.julialang.org/t/vscode-error-cannot-read-property-file-of-undefined/71710/4 "2021-12-10T04:34:40Z")

</div>

What do you have under Julia: Executable Path in the settings (Settings → Extensions → Julia)?  
I had this issue previously because I had an invalid path there.

---

<div class="post-metadata">

**Author:** ![Sharon-Liang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sharon-liang/32/30918_2.png) [@Sharon-Liang](https://discourse.julialang.org/u/Sharon-Liang)\
**Post date:** [December 22, 2021, 6:52am UTC](https://discourse.julialang.org/t/vscode-error-cannot-read-property-file-of-undefined/71710/5 "2021-12-22T06:52:10Z")

</div>

![截屏2021-12-22 下午2.50.51](https://global.discourse-cdn.com/julialang/original/3X/4/f/4f12eed9f817f707d9618025ac501bf9e0f080ec.png)  
This is the screenshot. Yes, it persist after closing and re-opening VSCode.

---

<div class="post-metadata">

**Author:** ![Sharon-Liang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sharon-liang/32/30918_2.png) [@Sharon-Liang](https://discourse.julialang.org/u/Sharon-Liang)\
**Post date:** [December 22, 2021, 6:56am UTC](https://discourse.julialang.org/t/vscode-error-cannot-read-property-file-of-undefined/71710/6 "2021-12-22T06:56:55Z")

</div>

Problem solved by changing the Executable Path from “/home/software/julia-1.6.4/bin” to “/home/software/julia-1.6.4/bin/julia”  
Thank you!

---

<div class="post-metadata">

**Author:** ![Broccolbadger](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/broccolbadger/32/27541_2.png) [@Broccolbadger](https://discourse.julialang.org/u/Broccolbadger)\
**Post date:** [January 20, 2022, 4:21pm UTC](https://discourse.julialang.org/t/vscode-error-cannot-read-property-file-of-undefined/71710/7 "2022-01-20T16:21:13Z")

</div>

On Windows, adding the .exe solved it for me

---

<div class="post-metadata">

**Author:** ![Si\_Chen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/si_chen/32/37487_2.png) [@Si\_Chen](https://discourse.julialang.org/u/Si_Chen)\
**Post date:** [June 30, 2022, 9:15pm UTC](https://discourse.julialang.org/t/vscode-error-cannot-read-property-file-of-undefined/71710/8 "2022-06-30T21:15:07Z")

</div>

Hello all, I had a hard time solving the same problem. The difference from @Sharon-Liang 's is that I am running VS code from a workstation and do “Remote-SSH Connect to Host…” to connect to another remoter server. VS code and Julia can run well with ⇧(shift)+enter at local workstation. But it doesn’t work for the remote server where I have to run include(“test.jl”) to run the code.

In both case, it is blank in Julia: Executable Path in the settings (Settings → Extensions → Julia). And even if I entered /alt/applic/user-maint/sc2350/julia-1.7.2/bin/julia to the server setting, it doesn’t help.

The /alt/applic/user-maint/sc2350/julia-1.7.2/bin/julia is actually the path for local workstation. In the server, I need to do “module load” to load julia/1.7.2.

Thank you for your help! @logankilpatrick @hdavid16

---

<div class="post-metadata">

**Author:** ![Sharon-Liang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sharon-liang/32/30918_2.png) [@Sharon-Liang](https://discourse.julialang.org/u/Sharon-Liang)\
**Post date:** [July 1, 2022, 4:49am UTC](https://discourse.julialang.org/t/vscode-error-cannot-read-property-file-of-undefined/71710/9 "2022-07-01T04:49:01Z")

</div>

You choud use:  
whereis julia  
to find its location, and fill it in the Julia:Executable Path.

For example, the Executable Path of Julia in my remote server is “/cm/shared/apps/julia-1.7.1/bin/julia”.

Hope it helps 🙂

[  
 ![](https://global.discourse-cdn.com/julialang/original/3X/5/a/5ac236ea44b87938959d46dbb6716f19ce3bca53.jpeg)  
Shuang(Sharon)-Liang

Institute of Physics, CAS  
[sliang@iphy.ac.cn](mailto:sliang@iphy.ac.cn)

]([头像签名](https://maas.mail.163.com/dashi-web-extend/html/proSignature.html?ftlId=1&name=Shuang%28Sharon%29-Liang&uid=sliang%40iphy.ac.cn&iconUrl=https%3A%2F%2Fmail-online.nosdn.127.net%2Fwzpmmc%2F1207c0c4d9bf5bc25ad826ad66cc6b13.jpg&company=Institute+of+Physics%2C+CAS&items=%5B%22sliang%40iphy.ac.cn%22%5D))

---- Replied Message ----

> From | [Si Chen via JuliaLang](mailto:notifications@julialang.discoursemail.com)[notifications@julialang.discoursemail.com](mailto:notifications@julialang.discoursemail.com) |
> 
> - | - |  
> Date | 07/01/2022 05:20 |  
> To | [sliang@iphy.ac.cn](mailto:sliang@iphy.ac.cn)[sliang@iphy.ac.cn](mailto:sliang@iphy.ac.cn) |  
> Cc | |  
> Subject | [JuliaLang] VScode error: Cannot read property ‘file’ of undefined |

> ![](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/si_chen/45/37487_2.png "Si\_Chen") | [Si\_Chen](https://discourse.julialang.org/u/si_chen)  
> June 30 |
> 
> - | - |

Hello all, I had a hard time solving the same problem. The difference from [@Sharon-Liang](https://discourse.julialang.org/u/sharon-liang) 's is that I am running VS code from a workstation and do “Remote-SSH Connect to Host…” to connect to another remoter server. VS code and Julia can run well with ⇧(shift)+enter at local workstation. But it doesn’t work for the remote server where I have to run include(“test.jl”) to run the code.

In both case, it is blank in Julia: Executable Path in the settings (Settings → Extensions → Julia). And even if I entered /alt/applic/user-maint/sc2350/julia-1.7.2/bin/julia to the server setting, it doesn’t help.

The /alt/applic/user-maint/sc2350/julia-1.7.2/bin/julia is actually the path for local workstation. In the server, I need to do “module load” to load julia/1.7.2.

Thank you for your help! [@logankilpatrick](https://discourse.julialang.org/u/logankilpatrick) [@hdavid16](https://discourse.julialang.org/u/hdavid16)

---

<div class="post-metadata">

**Author:** ![Si\_Chen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/si_chen/32/37487_2.png) [@Si\_Chen](https://discourse.julialang.org/u/Si_Chen)\
**Post date:** [July 1, 2022, 8:41am UTC](https://discourse.julialang.org/t/vscode-error-cannot-read-property-file-of-undefined/71710/10 "2022-07-01T08:41:36Z")

</div>

Thank you @Sharon-Liang for your help! `whereis julia` is working great to solve my problem!  
Best,  
Si
