Better error message when using vectors in statics

Closes #10487