In my testing, it appeared that the extension did not load when I had only CairoMakie and SomePackage installed in the main environment. The dependency of the extension is Makie, which is also always a dependency of CairoMakie (and GLMakie, etc.). But the users usually don’t install Makie directly. So I wonder if this is on purpose, or if I configured something incorrectly, etc.
Extensions definitely load whenever their weakdep is loaded, even indirectly by some other package. That’s the only sane approach, so that extensions are basically transparent to the user.
You mention the “main environment”, maybe the issue is that your package and Makie are installed in different envs? Never tried this scenario.
You can clone GitHub - jkrumbiegel/MakiePkgExtTest and activate the outer environment. It currently has both CairoMakie and Makie installed. In that mode, I can access the extension. If I rm Makie, I can’t, even though it is still installed via CairoMakie.