Uncaught TypeError Cannot change property of ‘changeSelection’ of undefined in Magento

I was working on a client site recently and after upgrading the site to Magento certain areas of the site started misbehaving namely the bundled products aren’t working properly. On loading any of the product pages,  it already went wrong with the following error in the console: Uncaught TypeError: Cannot read property ‘reloadPrice’ of[…]