I think something is wrong about the combination of CairoMakie, Julia 1.8, and VScode. I had eliminated the errors (reported in OP) during using CairoMakie in VScode terminal once, but suddenly the same errors started showing up again. I did
(@v1.8) pkg> rm CairoMakie
(@v1.8) pkg> add CairoMakie
julia> using CairoMakie
but the errors didn’t go away. Then I tried to restart VScode between rm CairoMakie and add CairoMakie:
(@v1.8) pkg> rm CairoMakie
# restart VScode here
(@v1.8) pkg> add CairoMakie
julia> using CairoMakie
and the errors disappeared.
Reinstalling CairoMakie takes quite a while, so having to repeat the above procedure occasionally will hurt my productivity significantly. I think the Makie developers need to take this issue seriously.
UPDATE. A similar error occurred again today, and I tried restarting REPL instead of restarting VScode. It didn’t solve the error. I had to restart VScode between rm CairoMakie and add CairoMakie.