Http not found on device

I’m getting this error which is a bit strange

2018-04-23 09:13:04 +01:00 [Device] ERROR: the index ‘http’ does not exist
2018-04-23 09:13:04 +01:00 [Device] ERROR: in main device_code:13

I thought the http object was always available on the device? The docs say “The http object is instantiated automatically.

Oh may bad… too early. Pasted the agent code into the device side.