Code:
Message: Interface\AddOns\Test\modules\test1.lua:73: attempt to index global 'frame' (a nil value)
Oops, forgot the argument to the function call. Please add the "frame" argument:
Lua Code:
hooksecurefunc("CompactUnitFrame_UpdateVisible", function(frame)
(I also corrected the snippet in my first post)