.iterm2_shell_integration.bash returns -t bad option

Starting iTerm (or Terminal) returns this error: ".iterm2_shell_integration.bash:type:306: bad option: -t"

Note: I changed my shell to Mac OX Catalina's new standard /bin/zsh/ and integrated it with "[[ -e ~/.profile ]] && emulate sh -c 'source ~/.profile'%" in .zprofile

How to deal with this issue?