# Seeking help with Pkg extensions: encountering MethodError: no method matching stat\_rep(::Nothing)

**URL:** <https://discourse.julialang.org/t/seeking-help-with-pkg-extensions-encountering-methoderror-no-method-matching-stat-rep-nothing/98906>\
**Category:** General Usage\
**Tags:** pkg, package-extensions\
**Created:** [May 16, 2023, 2:57am UTC](https://discourse.julialang.org/t/seeking-help-with-pkg-extensions-encountering-methoderror-no-method-matching-stat-rep-nothing/98906 "2023-05-16T02:57:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jishnub](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jishnub/32/33620_2.png) [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Post date:** [May 16, 2023, 2:57am UTC](https://discourse.julialang.org/t/seeking-help-with-pkg-extensions-encountering-methoderror-no-method-matching-stat-rep-nothing/98906/1 "2023-05-16T02:57:50Z")

</div>

I’m trying to use Pkg extensions in `OffsetArrays` in [Move `Adapt` to a weak dependency by jishnub · Pull Request #331 · JuliaArrays/OffsetArrays.jl · GitHub](https://github.com/JuliaArrays/OffsetArrays.jl/pull/331), where the Project.toml reads

> <https://github.com/JuliaArrays/OffsetArrays.jl/blob/6fe10f0145c3ae5163f567e8916c1d282f3a9763/Project.toml>

While trying to add packages to this branch, I face an error:

```julia
$ julia --project -e 'using Pkg; Pkg.add(["SnoopCompileCore", "SnoopCompile"])' [22:04:05]
   Resolving package versions...
    Updating `~/Dropbox/JuliaPackages/OffsetArrays.jl/Project.toml`
  [79e6a3ab] ERROR: MethodError: no method matching stat_rep(::Nothing)

Closest candidates are:
  stat_rep(::Pkg.Types.PackageSpec; name)
   @ Pkg ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Pkg/src/Operations.jl:2045

Stacktrace:
  [1] print_diff
    @ ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Pkg/src/Operations.jl:2068 [inlined]
  [2] print_status(env::Pkg.Types.EnvCache, old_env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, header::Symbol, uuids::Vector{Base.UUID}, names::Vector{String}; manifest::Bool, diff::Bool, ignore_indent::Bool, outdated::Bool, extensions::Bool, io::Base.TTY, mode::Pkg.Types.PackageMode, hidden_upgrades_info::Bool, show_usagetips::Bool)
    @ Pkg.Operations ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Pkg/src/Operations.jl:2344
  [3] print_status
    @ ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Pkg/src/Operations.jl:2233 [inlined]
  [4] status(env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, pkgs::Vector{Pkg.Types.PackageSpec}; header::Symbol, mode::Pkg.Types.PackageMode, git_diff::Bool, env_diff::Pkg.Types.EnvCache, ignore_indent::Bool, io::Base.TTY, outdated::Bool, extensions::Bool, hidden_upgrades_info::Bool, show_usagetips::Bool)
    @ Pkg.Operations ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Pkg/src/Operations.jl:2464
  [5] status (repeats 2 times)
    @ ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Pkg/src/Operations.jl:2435 [inlined]
  [6] #show_update#167
    @ ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Pkg/src/Operations.jl:2431 [inlined]
  [7] add(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, new_git::Set{Base.UUID}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform)
    @ Pkg.Operations ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Pkg/src/Operations.jl:1393
  [8] add
    @ ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Pkg/src/Operations.jl:1372 [inlined]
  [9] add(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform, kwargs::Base.Pairs{Symbol, Base.TTY, Tuple{Symbol}, NamedTuple{(:io,), Tuple{Base.TTY}}})
    @ Pkg.API ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Pkg/src/API.jl:275
 [10] add(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Pkg.API ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Pkg/src/API.jl:156
 [11] add(pkgs::Vector{Pkg.Types.PackageSpec})
    @ Pkg.API ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Pkg/src/API.jl:145
 [12] #add#25
    @ ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Pkg/src/API.jl:144 [inlined]
 [13] add(pkgs::Vector{String})
    @ Pkg.API ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Pkg/src/API.jl:144
 [14] top-level scope
    @ none:1

```

I’m unsure about what’s causing this, but given that this is my first attempt at Pkg extensions, it’s possible that I’ve not set things up correctly. Some help is welcome!

---

<div class="post-metadata">

**Author:** ![jishnub](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jishnub/32/33620_2.png) [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Post date:** [May 17, 2023, 6:23am UTC](https://discourse.julialang.org/t/seeking-help-with-pkg-extensions-encountering-methoderror-no-method-matching-stat-rep-nothing/98906/2 "2023-05-17T06:23:07Z")

</div>

Looks like this is a known issue, so there’s nothing to be done here.

> <https://github.com/JuliaLang/Pkg.jl/issues/3327>
>
> \`\`\`
> ERROR: LoadError: MethodError: no method matching stat\_rep(::Nothing)
> Clos…est candidates are:
> stat\_rep(::Pkg.Types.PackageSpec; name)
> @ Pkg /opt/julia/julia-1.9.0/share/julia/stdlib/v1.9/Pkg/src/Operations.jl:1991
> Stacktrace:
> \[1\] print\_diff
> @ /opt/julia/julia-1.9.0/share/julia/stdlib/v1.9/Pkg/src/Operations.jl:2014 \[inlined\]
> \[2\] print\_status(env::Pkg.Types.EnvCache, old\_env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, header::Symbol, uuids::Vector{Base.UUID}, names::Vector{String}; man
> ifest::Bool, diff::Bool, ignore\_indent::Bool, outdated::Bool, extensions::Bool, io::Base.TTY, mode::Pkg.Types.PackageMode, hidden\_upgrades\_info::Bool, show\_usagetips::Bool)
> @ Pkg.Operations /opt/julia/julia-1.9.0/share/julia/stdlib/v1.9/Pkg/src/Operations.jl:2290\*\*
> \`\`\`
> Julia 1.9 beta3
