Offset is outside the bounds of the DataView, the debugger shows it is inside the bounds

I get the error Offset is outside the bounds of the DataView for the following code let data = […] // some array of Int16 let buf = new ArrayBuffer(data.length); let dataView = new DataView(buf); …