How do I troubleshoot a cycle computer?
First of all, try changing the distance and vertical alignment between the sensor and the wheel-mounted magnet.

If that doesn’t help, the sensor (or its cable) mounted to the fork is probably broken. Check the cable for any visible damage. I think the sensors are usually cheap&amp;simple reed switches to detect the magnet. If you have a multimeter you could try measuring the resistance between the two contacts of the cycle computer’s mount. It should toggle between zero and infinity when you pass the magnet in front of the sensor. If it doesn’t do that it confirms a sensor or cable defect.

Your best choice is a replacement part, but if you are handy you could try replacing the cable and/or the reed contact.