ohmyzsh: compinit:480: compdump: function definition file not found
Describe the bug
Everytime I run the zsh command it will gives me the following error
compinit:480: compdump: function definition file not found
Steps to reproduce
zsh
Expected behavior
my oh-my-zsh on terminal works fine after I initiate a new terminal but not Ok when I run zsh, but on vs-code it didn’t even initiate properly, it gives me the error of
compinit:480: compdump: function definition file not found
/Users/tdu1/.sdkman/bin/sdkman-init.sh:194: bashcompinit: function definition file not found
/Users/tdu1/.sdkman/contrib/completion/bash/sdk:82: command not found: complete
/var/folders/lt/9vv4z6ys2cz7b0ry43z0y02h0000gp/T/vscode-zsh/.zshrc:126: add-zsh-hook: function definition file not found
/var/folders/lt/9vv4z6ys2cz7b0ry43z0y02h0000gp/T/vscode-zsh/.zshrc:127: add-zsh-hook: function definition file not found
Screenshots and recordings
No response
OS / Linux distribution
MacOS 12.3.1
Zsh version
zsh 5.9 (x86_64-apple-darwin21.3.0)
Terminal emulator
Terminal.app
If using WSL on Windows, which version of WSL
No response
Additional context
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 10
- Comments: 35 (12 by maintainers)
I ran across this issue as well.
TLDR; add
ZSH_DISABLE_COMPFIX=trueto the top of your .zshrc to fix this on MacOS with zsh installed via homebrew.When running /bin/zsh, it works fine because the fpath is using the system locations. But, /opt/homebrew/bin/zsh fails with
compinit:480: compdump: function definition file not found. Looking at thefpathfor homebrew’s zsh, it appeared that its fpath locations weren’t present. But, if you try adding them, they get reset:Digging deeper, the issue is with
compauditin Oh My Zsh’s lib/compfix.zsh file. You can disable this functionality by addingZSH_DISABLE_COMPFIX=trueto the top of your .zshrc. The issue is likely due to directory permissions, which can be dealt with by runningbrew doctor, but if you are on a multi-user system like a family computer, that can be problematic.ok solved by
brew uninstall zsh.adding ZSH_DISABLE_COMPFIX=true at the top of my .zshrc file fixed it for me on vscode Terminal. I’m using macos Sonoma 14.0
@scotch83 I also ran into this issue and fixed it by seeing my $FPATH contents outside of vscode:
And putting the contents at the top of my ~/.zshrc:
This started occurring after upgrading to macOS Sonoma (version 14.0). Apple M1 Pro.
I was prevented from uninstalling zsh via
brew uninstall zsh. Instead I removed the path found atls -la /opt/homebrew/bin/zshand removed/opt/homebrew/bin/zshand restarted the terminal to get the macOS-provided version of zsh. 👍I had the same problem.
brew uninstall zshand rebooting solved the problem for me. Thanks @tdu1-godaddyI am getting this problem in VSCode’s terminal on an M2 Mac. In the standard terminal, it works fine, and both worked fine on my older Mac
I had the same problem.
brew uninstall zshworked. Thanks @tdu1-godaddy