Cannot read property ‘platform’ of undefined