# Error using REPL with custom system image

**URL:** <https://discourse.julialang.org/t/error-using-repl-with-custom-system-image/127940>\
**Category:** General Usage\
**Tags:** question, package-compiler\
**Created:** [April 10, 2025, 4:47pm UTC](https://discourse.julialang.org/t/error-using-repl-with-custom-system-image/127940 "2025-04-10T16:47:12Z")\
**Posts on this page:** 2\
**Page:** 1

<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:** [April 10, 2025, 4:47pm UTC](https://discourse.julialang.org/t/error-using-repl-with-custom-system-image/127940/1 "2025-04-10T16:47:12Z")

</div>

If I create a system image for KiteModels.jl this works. But using it fails with the following error:

```julia
ufechner@framework:~/repos/KiteModels.jl$ jl
Found system image!
[Info: Precompiling REPL [3fa0cd96-eef1-5676-8a61-b3b8758bbffb] (cache misses: mismatched flags (4), wrong julia version (2))
ERROR: LoadError: invalid redefinition of constant Precompile.SparseArraysExt
Stacktrace:
  [1] top-level scope
    @ none:1
  [2] eval
    @ ./boot.jl:430 [inlined]
  [3] eval
    @ ~/.julia/juliaup/julia-1.11.4+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/precompile.jl:3 [inlined]
  [4] top-level scope
    @ ~/.julia/juliaup/julia-1.11.4+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/precompile.jl:10
  [5] include(mod::Module, _path::String)
    @ Base ./Base.jl:557
  [6] include(x::String)
    @ REPL ~/.julia/juliaup/julia-1.11.4+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/REPL.jl:15
  [7] top-level scope
    @ ~/.julia/juliaup/julia-1.11.4+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/REPL.jl:1748
  [8] include
    @ ./Base.jl:557 [inlined]
  [9] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
    @ Base ./loading.jl:2881
 [10] top-level scope
    @ stdin:6
in expression starting at /home/ufechner/.julia/juliaup/julia-1.11.4+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/precompile.jl:3
in expression starting at /home/ufechner/.julia/juliaup/julia-1.11.4+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/REPL.jl:3
in expression starting at stdin:6
┌ Warning: Failed to import REPL
│ exception =
│ Failed to precompile REPL [3fa0cd96-eef1-5676-8a61-b3b8758bbffb] to "/home/ufechner/.julia/compiled/v1.11/REPL/jl_H6uyIX".
│ Stacktrace:
│ [1] error(s::String)
│ @ Base ./error.jl:35
│ [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool; flags::Cmd, cacheflags::Base.CacheFlags, reasons::Dict{String, Int64}, loadable_exts::Nothing)
│ @ Base ./loading.jl:3174
│ [3] (::Base.var"#1110#1111"{Base.PkgId})()
│ @ Base ./loading.jl:2579
│ [4] mkpidlock(f::Base.var"#1110#1111"{Base.PkgId}, at::String, pid::Int32; kwopts::@Kwargs{stale_age::Int64, wait::Bool})
│ @ FileWatching.Pidfile ~/.julia/juliaup/julia-1.11.4+0.x64.linux.gnu/share/julia/stdlib/v1.11/FileWatching/src/pidfile.jl:95
│ [5] #mkpidlock#6
│ @ ~/.julia/juliaup/julia-1.11.4+0.x64.linux.gnu/share/julia/stdlib/v1.11/FileWatching/src/pidfile.jl:90 [inlined]
│ [6] trymkpidlock(::Function, ::Vararg{Any}; kwargs::@Kwargs{stale_age::Int64})
│ @ FileWatching.Pidfile ~/.julia/juliaup/julia-1.11.4+0.x64.linux.gnu/share/julia/stdlib/v1.11/FileWatching/src/pidfile.jl:116
│ [7] #invokelatest#2
│ @ ./essentials.jl:1057 [inlined]
│ [8] invokelatest
│ @ ./essentials.jl:1052 [inlined]
│ [9] maybe_cachefile_lock(f::Base.var"#1110#1111"{Base.PkgId}, pkg::Base.PkgId, srcpath::String; stale_age::Int64)
│ @ Base ./loading.jl:3698
│ [10] maybe_cachefile_lock
│ @ ./loading.jl:3695 [inlined]
│ [11] _require(pkg::Base.PkgId, env::Nothing)
│ @ Base ./loading.jl:2565
│ [12] __require_prelocked(uuidkey::Base.PkgId, env::Nothing)
│ @ Base ./loading.jl:2388
│ [13] #invoke_in_world#3
│ @ ./essentials.jl:1089 [inlined]
│ [14] invoke_in_world
│ @ ./essentials.jl:1086 [inlined]
│ [15] _require_prelocked
│ @ ./loading.jl:2375 [inlined]
│ [16] _require_prelocked
│ @ ./loading.jl:2374 [inlined]
│ [17] macro expansion
│ @ ./loading.jl:2693 [inlined]
│ [18] macro expansion
│ @ ./lock.jl:273 [inlined]
│ [19] require_stdlib(package_uuidkey::Base.PkgId, ext::Nothing)
│ @ Base ./loading.jl:2648
│ [20] require_stdlib
│ @ ./loading.jl:2644 [inlined]
│ [21] load_REPL()
│ @ Base ./client.jl:410
│ [22] run_main_repl(interactive::Bool, quiet::Bool, banner::Symbol, history_file::Bool, color_set::Bool)
│ @ Base ./client.jl:425
│ [23] repl_main
│ @ ./client.jl:567 [inlined]
│ [24] _start()
│ @ Base ./client.jl:541
└ @ Base client.jl:412
┌ Warning: REPL provider not available: using basic fallback
│ LOAD_PATH = "@:@v#.#:@stdlib"
└ @ Base client.jl:451

```

What could be the reason?

Should I add REPL to Project.toml? Should I include it in the list of packages to be pre-compiled?

---

<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:** [April 10, 2025, 6:46pm UTC](https://discourse.julialang.org/t/error-using-repl-with-custom-system-image/127940/2 "2025-04-10T18:46:18Z")

</div>

I could solve this issue by adding REPL to the system image, which was not a separate package in the past, but now it is.
