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

As of v1.11, when using the recommended script to automatically start OhMyREPL.jl with 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.

1 Like

You hit this issue: "UndefRefError: access to undefined reference" in 1.11 beta · Issue #345 · KristofferC/OhMyREPL.jl · GitHub

Which is this Julia issue v1.11 errors when loading REPL and Pkg · Issue #56111 · JuliaLang/julia · GitHub which shall be fixed in Julia 1.11.1 .

1 Like

Oh, I was staring right at it in the issue list :expressionless: 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 in the meantime by simply prepending using Pkg: Pkg to startup.jl. As for the reason this happens, it’s suggested 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!

5 Likes