Documenter "undefined binding" error

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,
the fuction declaration is at line 833 here
and the export is at line 134 here.

[ 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.

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

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 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

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

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.

1 Like