Retrieving Items from previous nodes

Im running the latest version of n8n on cloudron. Unfortunately I cant share the data but I dont think that matters here. Ive seen here

that this function

const allItems = $items("Filter Tasks");

should output all the items in the split out node but it returns this error instead

ERROR: Code doesn't return an object [item 0]
Please return an object representing the output item. ('undefined' was returned instead.)