# Startup.jl error with OhMyREPL.jl as of v1.11

**URL:** <https://discourse.julialang.org/t/startup-jl-error-with-ohmyrepl-jl-as-of-v1-11/121241>\
**Category:** General Usage\
**Tags:** package, startup, ohmyrepl\
**Created:** [October 13, 2024, 3:51am UTC](https://discourse.julialang.org/t/startup-jl-error-with-ohmyrepl-jl-as-of-v1-11/121241 "2024-10-13T03:51:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![NonDairyNeutrino](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nondairyneutrino/32/221496_2.png) [@NonDairyNeutrino](https://discourse.julialang.org/u/NonDairyNeutrino)\
**Post date:** [October 13, 2024, 3:51am UTC](https://discourse.julialang.org/t/startup-jl-error-with-ohmyrepl-jl-as-of-v1-11/121241/1 "2024-10-13T03:51:46Z")

</div>

As of v1.11, when using the recommended script to [automatically start `OhMyREPL.jl` with Julia](https://kristofferc.github.io/OhMyREPL.jl/latest/installation/#Automatically-start-with-Julia.)

```julia
# ~/.julia/config/startup.jl
atreplinit() do repl
    try
        @eval using OhMyREPL
    catch e
        @warn "error while importing OhMyREPL" e
    end
end

```

the error passed to `@warn` shows

> InitError: UndefRefError: access to undefined reference during initialization of module REPLExt

Contrasting this, when in the REPL, `using OhMyREPL` works just fine.

Additionally, when using this `startup.jl`, subsequently `pkg> status` yields nothing and no packages in the environment are recognized.

Finally, if OhMyREPL is removed from the environment with `pkg> remove OhMyREPL` so that `using OhMyREPL` in the startup file **should** error in trying to find the package, that does happen and everything else works fine.

I frankly have absolutely no idea how to really interpret the error message, and thus how to potentially fix the issue.

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [October 13, 2024, 3:57am UTC](https://discourse.julialang.org/t/startup-jl-error-with-ohmyrepl-jl-as-of-v1-11/121241/2 "2024-10-13T03:57:51Z")

</div>

You hit this issue: ["UndefRefError: access to undefined reference" in 1.11 beta · Issue #345 · KristofferC/OhMyREPL.jl · GitHub](https://github.com/KristofferC/OhMyREPL.jl/issues/345)

Which is this Julia issue [v1.11 errors when loading REPL and Pkg · Issue #56111 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues/56111) which shall be fixed in Julia 1.11.1 .

---

<div class="post-metadata">

**Author:** ![NonDairyNeutrino](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nondairyneutrino/32/221496_2.png) [@NonDairyNeutrino](https://discourse.julialang.org/u/NonDairyNeutrino)\
**Post date:** [October 13, 2024, 4:15am UTC](https://discourse.julialang.org/t/startup-jl-error-with-ohmyrepl-jl-as-of-v1-11/121241/3 "2024-10-13T04:15:15Z")

</div>

Oh, I was staring right at it in the issue list 😑 I guess I was looking for something more recent as I guess I assumed something like this would have been fixed during the beta. In the linked OhMyREPL issue, there appears to be a **[workaround](https://github.com/KristofferC/OhMyREPL.jl/issues/345#issuecomment-2397745411) in the meantime by simply prepending `using Pkg: Pkg` to `startup.jl`.** As for the reason this happens, it’s [suggested](https://github.com/KristofferC/OhMyREPL.jl/issues/345#issuecomment-2209009823) that it’s because Pkg.jl has been moved out of the system image as of v1.11.

Hopefully this post will serve for future seekers. Thanks!
