TypeScript’s Type System, 62 bytes
type U<N,L extends 1[]=[]>=L extends{length:N}?L:U<N,[...L,1]> Try it at the TypeScript Playground!
Type definition taking a generic integer type and recursively appending 1 to a tuple type until it’sits length is the integer type.