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

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)

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

This image serves both JupyterLab and code-server (aka Code - OSS).
:point_right: Currently JuypterLab v4.2.5, Code v1.93.1 and Jupyter extension v2024.8.1.