Here are the steps to reproduce this issue:
1. emacs -q
2. [M-x package-initialize]
3. [C-x C-f] to an file.sh
4. [M-x sh-mode] to enable sh-mode.
5. [M-: (require 'imenu)] to load imenu. (I don't explicitly load Imenu in my init files. but some packages load it automatically)
6. [M-x company-mode] to enable company-mode
7. in buffer, type fun, then got error:
```
imenu unavailable: "No items suitable for an index found in this buffer"" with args (candidates function)
```