Try this out..
The require function is defined by OpenOS which isn't available in the drone env.
require is used to load libraries from the package path. See /lib/package.lua
local drone = component.proxy(component.list('drone')())
local position = component.proxy(component.list('navigation')()).getPosition()
-- # The require keyword is for libraries accessed via a filesystem which the drone doesn't have. Therefor it isn't available.
-- # The `component.someComponentName` functionality is defined in the OpenOS component library.. Again, not available here.
if position ~= nil th