Now if dimnames is NULL then it is handled, but there might be some of dimnames NULL
a = array(1:8, dim=c(2L,2L,2L), dimnames=list(NULL, NULL, as.character(1:2)))
d = as.data.table(a)
#Error in data.table(do.call(CJ, c(val, sorted = FALSE)), N = as.vector(x)) :
# Item 1 has no length. Provide at least one item (such as NA, NA_integer_ etc) to be repeated to match the 8 rows in the longest column. Or, all columns can be 0 length, for insert()ing rows into.
Now if dimnames is NULL then it is handled, but there might be some of dimnames NULL