# ReadOnlyMemory Error in VS Code

**URL:** <https://discourse.julialang.org/t/readonlymemory-error-in-vs-code/74737>\
**Category:** New to Julia\
**Tags:** error, vscode, mac-m1\
**Created:** [January 17, 2022, 7:26am UTC](https://discourse.julialang.org/t/readonlymemory-error-in-vs-code/74737 "2022-01-17T07:26:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vikram-s-narayan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vikram-s-narayan/32/32862_2.png) [@vikram-s-narayan](https://discourse.julialang.org/u/vikram-s-narayan)\
**Post date:** [January 17, 2022, 7:26am UTC](https://discourse.julialang.org/t/readonlymemory-error-in-vs-code/74737/1 "2022-01-17T07:26:29Z")

</div>

I’m on a MacBook Air (M1, 2020).

If I run the following code in VS Code, I get an error ("ERROR: LoadError: ReadOnlyMemoryError()).

But if I run it in a standalone REPL opened in a terminal, I don’t get the error.

Any pointers on how I can begin to debug and understand this?

```julia
using Surrogates
f = x -> exp(x)*x^2+x^3
lb = 0.0
ub = 10.0
x = sample(100,lb,ub,UniformSample())
y = f.(x)
p = 1.9
my_krig = Kriging(x,y,lb,ub,p=p)

```
