Failed to precompile Flux

Seeing different threads related to packages precompilation, as beginner I understand is due mostly to packages releases incompatibilities.

Still due Pluto has his own embedded package manager I’m not sure how to manage this.

So coming to my error having “using Flux” get this error

ERROR: LoadError: UndefVarError: __source__ not defined
Stacktrace:
 [1] var"@nograd"(__source__::LineNumberNode, __module__::Module, ex::Any)
   @ Zygote ~/.julia/packages/Zygote/oMScO/src/lib/grad.jl:7
 [2] include(mod::Module, _path::String)
   @ Base ./Base.jl:419
 [3] include(x::String)
   @ Zygote ~/.julia/packages/Zygote/oMScO/src/Zygote.jl:1
 [4] top-level scope
   @ ~/.julia/packages/Zygote/oMScO/src/Zygote.jl:22
 [5] include
   @ ./Base.jl:419 [inlined]
 [6] 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, UInt64}}, source::String)
   @ Base ./loading.jl:1554
 [7] top-level scope
   @ stdin:1
in expression starting at /home/davide445/.julia/packages/Zygote/oMScO/src/lib/lib.jl:30
in expression starting at /home/davide445/.julia/packages/Zygote/oMScO/src/lib/lib.jl:30
in expression starting at /home/davide445/.julia/packages/Zygote/oMScO/src/Zygote.jl:1
in expression starting at stdin:1
ERROR: LoadError: Failed to precompile Zygote [e88e6eb3-aa80-5325-afca-941959d7151f] to /home/dzari/.julia/compiled/v1.8/Zygote/jl_uWKP5g.
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)
    @ Base ./loading.jl:1707
  [3] compilecache
    @ ./loading.jl:1651 [inlined]
  [4] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1337
  [5] _require_prelocked(uuidkey::Base.PkgId)
    @ Base ./loading.jl:1200
  [6] macro expansion
    @ ./loading.jl:1180 [inlined]
  [7] macro expansion
    @ ./lock.jl:223 [inlined]
  [8] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1144
  [9] include
    @ ./Base.jl:419 [inlined]
 [10] 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, UInt64}}, source::Nothing)
    @ Base ./loading.jl:1554
 [11] top-level scope
    @ stdin:1
in expression starting at /home/davide445/.julia/packages/Flux/2i5P1/src/Flux.jl:1
in expression starting at stdin:1

this is my packages status

(@v1.8) pkg> st
Status `~/.julia/environments/v1.8/Project.toml`
  [a93c6f00] DataFrames v1.4.3
  [5789e2e9] FileIO v1.16.0
  [587475ba] Flux v0.13.7
  [7073ff75] IJulia v1.23.3
  [916415d5] Images v0.25.2
  [18b7da76] JuliaAcademyData v0.1.0 `https://github.com/JuliaComputing/JuliaAcademyData.jl#main`
  [8b842266] PalmerPenguins v0.1.4
⌃ [91a5bcdd] Plots v1.36.2
  [c3e4b0f8] Pluto v0.19.16
  [6fc51010] Surrogates v6.5.1

Working on latest KDE Neon (based on Ubuntu 22.04).

In my file I was using Pkd.add() to add a specific external library before loading standard packages using the standard “using ” and give me this error.

Seems if I revert the order so first load standard packages and only next use Pkg.add the error is gone.

I suppose Pluto didn’t liked using Pkg that’s disabling internal package manager and next invoking it.