JavaScript, 40 bytes
f=a=>a/a||Math.max(a.length,...a.map(f))
JavaScript, 43 bytes
f=a=>Math.max(~~a.length,...a.map?.(f)??[])
f=a=>Math.max(~~a.length,...a.map?.(f)??[])
console.log(f([]))
console.log(f([1,2,3]))
console.log(f([[1,2,3]]))
console.log(f([1,2,[],1]))
console.log(f([1,[1,[8,2,[1,2],5,4,9]],2,[],3]))