Locally building docs complains that the parent package does not have a dependency

I have a local MyPackage project, with a docs subdirectory. Both were initially created by PkgTemplates.jl.

Before Pkg.adding dependencies to MyPackage, I tested the docs build process with Documenter.jl in Powershell with > cd docs then > julia make.jl. I’ve browsed the pages and they work.

After Pkg.adding dependencies, I try building the documentation again, and I get the error:

ERROR: LoadError: ArgumentError: Package MyPackage does not have Reexport in its dependencies:
- You may have a partially installed environment. Try `Pkg.instantiate()`
  to ensure all packages in the environment are installed.
- Or, if you have MyPackage checked out for development and have
  added Reexport as a dependency but haven't updated your primary
  environment's manifest file, try `Pkg.resolve()`.
- Otherwise you may need to report an issue with MyPackage

I’ve followed all the steps this error message suggested. I’ve deleted the manifest files involved. I’ve checked MyPackage in and out of dev. How do I fix this issue?

The usual workflow I use for this is first to setup the docs folder:

cd docs
julia --project

Then in the pkg REPL:

pkg] dev ..
pkg] resolve
pkg] instantiate

You should only need to do this once, or after you add dependencies to the outer project. After this is done, you can make with:

julia --project make.jl

Making sure you are in the docs folder, as --project will activate the project of the current folder. I think this is the part you are missing from what you have shown us. I hope this works!

2 Likes

Yes that works. Thank you!

1 Like