Apparently everything works if I use:
glTexImage3D(GL_TEXTURE_2D_ARRAY,
0,
eFormat,
uiWidth, uiHeight,
uiNumTexturesstatic_cast<uint32>(vPixelData.size()),
0,
eFormat,
GL_UNSIGNED_BYTE,
NULL);
instead of:
glTexStorage3D(GL_TEXTURE_2D_ARRAY,
1, // Number of mipmaps
eInternalFormat, // Internal format
uiWidth, uiHeight, // width, height
static_cast<uint32>(vPixelData.size()));