# Error in Visual studio code while good in Jupyter notebook with a same Julia code

**URL:** <https://discourse.julialang.org/t/error-in-visual-studio-code-while-good-in-jupyter-notebook-with-a-same-julia-code/121792>\
**Category:** VS Code\
**Tags:** question\
**Created:** [October 26, 2024, 6:14pm UTC](https://discourse.julialang.org/t/error-in-visual-studio-code-while-good-in-jupyter-notebook-with-a-same-julia-code/121792 "2024-10-26T18:14:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hyde](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hyde/32/52754_2.png) [@hyde](https://discourse.julialang.org/u/hyde)\
**Post date:** [October 26, 2024, 6:14pm UTC](https://discourse.julialang.org/t/error-in-visual-studio-code-while-good-in-jupyter-notebook-with-a-same-julia-code/121792/1 "2024-10-26T18:14:25Z")

</div>

Hi, I ran same code from the QuantEcon lecture [55. Default Risk and Income Fluctuations, (Arellano 2008 model)]. The Jupyter notebook showed exactly same result from the lecture, but Visual studio code keep giving an Error.  
I’d like to know what is the problem and how to fix it.  
Thank you.  
The error message is as follows:  
“ERROR: type MarkovChain has no field ygrid”  
Relevant lines are (italic is the line pointed out having problem) :  
function QuantEcon.simulate(ae,  
capT = 5000;  
_y\_init = mean(ae.ygrid)_,  
B\_init = mean(ae.Bgrid),)  
…

using Random

# set random seed for consistent result

Random.seed!(348938)

# simulate

T = 250  
_y\_vec, B\_vec, q\_vec, default\_vec = simulate(ae, T)_

---

<div class="post-metadata">

**Author:** ![benz0li](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/benz0li/32/37040_2.png) [@benz0li](https://discourse.julialang.org/u/benz0li)\
**Post date:** [October 27, 2024, 12:16pm UTC](https://discourse.julialang.org/t/error-in-visual-studio-code-while-good-in-jupyter-notebook-with-a-same-julia-code/121792/2 "2024-10-27T12:16:42Z")

</div>

@hyde I am interested in whether or not you can reproduce this on [https://demo.jupyter.b-data.ch](https://demo.jupyter.b-data.ch) with the `Julia (jupyterlab/julia/pubtools:latest)` image (Julia v1.11.1).  
ℹ Login with your GitHub account.

This image serves both [JupyterLab](https://github.com/jupyterlab/jupyterlab) and [code-server](https://github.com/coder/code-server) (aka [Code - OSS](https://github.com/microsoft/vscode)).  
👉 Currently JuypterLab v4.2.5, Code v1.93.1 and Jupyter extension v2024.8.1.
