Runtine error when attemptin to save atlas function

Hi,

I’m attempting to save the following function which runs successfully in the console but produces the message: Changes could not be saved. Please resolve the errors above → runtime error during function validation. I have insatlled the dependenceies. Can anyone exlain the error (and how to resolve it).

import { getWeek } from 'date-fns'
import { addWeeks } from 'date-fns'
import { getYear } from 'date-fns'



exports = function(barcode){
    
    const date = addWeeks(new Date(), -10)
    const week = getWeek(date).toString()
    const year = getYear(date).toString()
    const recallTarget = Number(year + week)
    const collection = context.services.get("mongodb-atlas").db("xNews").collection("products");
    const data = collection.find({ barcode: barcode, recallWeek: { $gte:recallTarget }})
    
  return data
};

Thanks.