How to debug "undefined" 404 error in console on front page
Thanks for the tips Clive and Beebee!

By trial and error I disabled or removed various components until I found one that made the error go away. In this case it seems to be a problem with Flexslider and Views that was used in a Views block -- I haven't solved it yet but have isolated it at least!

UPDATE: It seems to be a bug related to the navigation in the Flexslider module (Views integration). If I set the Flexslider style not to include navigation, it is fine.