I get an error when loading a new shell with `compdef` here:

    /Users/croaky/.zsh/functions/g:11: command not found: compdef

It worked for me in `zshrc`.