# Documenter "undefined binding" error

**URL:** <https://discourse.julialang.org/t/documenter-undefined-binding-error/129475>\
**Category:** General Usage\
**Tags:** documenter\
**Created:** [May 30, 2025, 12:11pm UTC](https://discourse.julialang.org/t/documenter-undefined-binding-error/129475 "2025-05-30T12:11:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marco-Congedo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marco-congedo/32/7321_2.png) [@Marco-Congedo](https://discourse.julialang.org/u/Marco-Congedo)\
**Post date:** [May 30, 2025, 12:11pm UTC](https://discourse.julialang.org/t/documenter-undefined-binding-error/129475/1 "2025-05-30T12:11:44Z")

</div>

I implemented a new function `sumOfSqrDiff` in package _PosDefManifold.jl_.  
I have exported it and added the doc string, but when i build the documentation  
i have the error here below.  
I don’t see what’s wrong and the solutions i can find in Discourse do not seem to help.  
I have pushed the new version in the `dev` branch.  
The doc block is [here](https://github.com/Marco-Congedo/PosDefManifold.jl/blob/dev/docs/src/linearAlgebra.md),  
the fuction declaration is at line 833 [here](https://github.com/Marco-Congedo/PosDefManifold.jl/blob/dev/src/linearAlgebra.jl)  
and the export is at line 134 [here](https://github.com/Marco-Congedo/PosDefManifold.jl/blob/dev/src/PosDefManifold.jl).

````julia
[ Info: SetupBuildDirectory: setting up build directory.
[ Info: Doctest: running doctests.
[ Info: ExpandTemplates: expanding markdown templates.
┌ Error: undefined binding 'sumOfSqrDiff' in `@docs` block in src\linearAlgebra.md:81-91
│ ```@docs
│ colProd
│ sumOfSqr
│ sumOfSqrDiff
│ sumOfSqrDiag
│ colNorm
│ sumOfSqrTril
│ tr
│ quadraticForm
│ fidelity
│ ```
└ @ Documenter C:\Users\congedom\.julia\packages\Documenter\iRt2s\src\utilities\utilities.jl:47
[ Info: CollectCitations
┌ Warning: No `bibfile`. Did you instantiate `bib = CitationBibliography(bibfile)` and pass `bib` to `makedocs` 
as an element of the `plugins` keyword argument?
└ @ DocumenterCitations C:\Users\congedom\.julia\packages\DocumenterCitations\FhKhO\src\DocumenterCitations.jl:108
[ Info: ExpandBibliography: expanding `@bibliography` blocks.
[ Info: ExpandCitations
[ Info: ExtCrossReferences: building external (DocumenterInterLinks) cross-references.
[ Info: CrossReferences: building cross-references.
[ Info: CheckDocument: running document checks.
[ Info: Populate: populating indices.
ERROR: `makedocs` encountered an error [:docs_block] -- terminating build before rendering.
Stacktrace:
 [1] error(s::String)
   @ Base .\error.jl:35
 [2] runner(::Type{Documenter.Builder.RenderDocument}, doc::Documenter.Document)
   @ Documenter C:\Users\congedom\.julia\packages\Documenter\iRt2s\src\builder_pipeline.jl:259
 [3] dispatch(::Type{Documenter.Builder.DocumentPipeline}, x::Documenter.Document)
   @ Documenter.Selectors C:\Users\congedom\.julia\packages\Documenter\iRt2s\src\utilities\Selectors.jl:170     
 [4] #88
   @ C:\Users\congedom\.julia\packages\Documenter\iRt2s\src\makedocs.jl:275 [inlined]
 [5] withenv(::Documenter.var"#88#90"{Documenter.Document}, ::Pair{String, Nothing}, ::Vararg{Pair{String, Nothing}})
   @ Base .\env.jl:265
 [6] #87
   @ C:\Users\congedom\.julia\packages\Documenter\iRt2s\src\makedocs.jl:274 [inlined]
 [7] cd(f::Documenter.var"#87#89"{Documenter.Document}, dir::String)
   @ Base.Filesystem .\file.jl:101
 [8] makedocs(; debug::Bool, format::Documenter.HTMLWriter.HTML, kwargs::@Kwargs{…})
   @ Documenter C:\Users\congedom\.julia\packages\Documenter\iRt2s\src\makedocs.jl:273
 [9] top-level scope
   @ c:\Users\congedom\Documents\Documenti\Code\julia\PosDefManifold\docs\make.jl:6
Some type information was truncated. Use `show(err)` to see complete types.

````

---

<div class="post-metadata">

**Author:** ![kellertuer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kellertuer/32/220707_2.png) [@kellertuer](https://discourse.julialang.org/u/kellertuer)\
**Post date:** [May 30, 2025, 2:18pm UTC](https://discourse.julialang.org/t/documenter-undefined-binding-error/129475/2 "2025-05-30T14:18:06Z")

</div>

I checked your `dev` branch and that seems indeed to export the new function in question – but does your Documenter use the right version as well? If Documenter has its own environment (in the `docs/Project.toml`) and that always loads the last registered version, you might compile the (new) markdown files of the docs using the (old) version of your package.

Because here

> <https://github.com/Marco-Congedo/PosDefManifold.jl/blob/dev/docs/Project.toml>

you just state to use your package, you do push paths to your docs in [PosDefManifold.jl/docs/make.jl at dev · Marco-Congedo/PosDefManifold.jl · GitHub](https://github.com/Marco-Congedo/PosDefManifold.jl/blob/dev/docs/make.jl) but the `using` still loads the one of your current environment, namely the one from the General Registry.

I would recommend to check whether it makes sense to activate the docs/ env in your make and put your package into development version on the parent branch, like these two lines do

> <https://github.com/JuliaManifolds/Manopt.jl/blob/72ecc6d72bc191de273506af75bef215fc836191/docs/make.jl#L85-L86>

You probably can also use the new `[sources]` section in the `Project.toml`, but I could not find how that worked so fast.

---

<div class="post-metadata">

**Author:** ![Marco-Congedo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marco-congedo/32/7321_2.png) [@Marco-Congedo](https://discourse.julialang.org/u/Marco-Congedo)\
**Post date:** [May 30, 2025, 6:03pm UTC](https://discourse.julialang.org/t/documenter-undefined-binding-error/129475/3 "2025-05-30T18:03:04Z")

</div>

Hi Ronny,

thanks a lot.  
I suspected something like that.  
The easy solution i found based on what you suggested is to remove the package from the general environment,  
then my make file uses the local package.  
This seems to work also remotely.
