getting a vector of float32 using $fetch and arraybuffer brings wrong results

I’m simply trying to fetch binary data created by writing float32Array data to a binary file. When fetched using fetch (in vue.js/nuxt3) the values are completely different from the original float32Array created on the server side.

Using node I’ve created the following file:

fs.writeFileSync(`${dir_path}/test.f32`, new Float32Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]), 'binary');

just for testing in node I’ve read it back using the following lines:

const f32test = fs.readFileSync(`${dir_path}/test.f32`);
const F32 = new Float32Array(f32test.buffer, f32test.byteOffset, f32test.length / 4);
console.log(F32);//[1,2,3,4,5,6,7,8,9...]

the data logged is exactly the same as the one created.

then I’ve created a rest API to get that file from the browser using $fetch (nuxt/vue):

const data = await $fetch('/api/vector', { responseType: "arrayBuffer" });
const f32 = new Float32Array(data, 0, data.byteLength / Float32Array.BYTES_PER_ELEMENT);

Here problems arises; data is an ArrayBuffer of 70bytes, not 60 as the one sent.
so when recreating the Float32Array view on it the values look random float.

The weird thing is that when I try the following command (to remove 10bytes)

new Float32Array(temp1.slice(10),0,15);

the result is partially correct:

[3, -1.8671875, 2.3223719449255193e-41, 5.9296793937683105, -1.8671875, 2.3223719449255193e-41, 5.9296793937683105, 8, 9, 10, 11, 12, 13, 14, 15]

just the last 8 values are correct!!!

I expected something like 15 random values or 15 correct values!
I really cannot understand what’s happening and how to get a vector of float from a rest API that seems something trivial to accomplish.
Am I missing something related to little-endian/big-endian?

I’ve tried with smaller and bigger vectors the effect is almost the same, and the array buffer received is bigger than the one sent.
The original data I’ve to send is approximately 1.5mbytes, and the array buffer received is 2.5mbytes. It’s really hard to get where the data begins and ends.

can anyone help?

thanks in advance