That depends on how discriminating the vaccine is. The problem that you raise is so obvious that it is hard to imagine a vaccine designer or the FDA overlooking it.
It does seem obvious.
I recall reading that the immune system usually ignores molecules below a certain (approximate) size. Even this virus is much larger than its entry spike. Maybe that’s part of the answer.