This usually means you don’t have the correct library installed. The easiest way is you can install the library using Arduino IDE. Go to Tools–>Manage Libraries then search for Servo. Then install the correct library. If it is already install, check if it has an update. Install the update. Then this should be fix.