Undefined is not an object (evaluating 'b64.length')

Hi
After doing some customization on CanCan, I receive the below error message from server. Anyone knows which file this might be from?

Failed to store video. [TypeError: undefined is not an object (evaluating 'b64.length')]

This is odd, I am tracking the error, it is failing here:
await (await CanCan.actor).createVideo(videoInit);
but I tracked and videoInit is received on canister and videoId is returned!

Actuay this happens on any await (await CanCan.actor)…

I am on iOS, any thoughts are much appreciated.

for clarity, you are seeing this error in the frontend console, right?

1 Like

yes. I am not using CanCan front-end. I am trying to connect a custom front-end to it.

I have verified that the actor is actually called and logs appear on the server and it even return the result correctly. However on the line CanCan.actor… it gives this error in front-end

On backend, I do not see any issues or error messages and everything seems to be fine. Although I have not checked if .put is actually putting data in place

My guess would be that there’s some missing attribute in the videoInit

1 Like

I checked that too, here is the videoInit, which looks ok.
Object {
“caption”: “test”,
“chunkCount”: 50,
“createdAt”: 1627656503674000,
“name”: “IMG_4724.MOV”,
“tags”: Array [
“test”,
],
“userId”: “II://zfhab-gwmc5-stn3s-aet7i-iwczy-pougc-rqr72-36tal-ew46m-anrdh-tqe”,
}

even a video Id gets created by server, but FO never receives it because of that error

This error is right after calling the canister actor and before unwrap (so it is not even unwrap as nothing gets to it becuase of this error)

I think I am getting close to the root. it has something to do with ‘react-native-fetch-api’ and ‘base64-js’.

I tested those with a simple text received from canister and were working, but they might be having issues with whatever CanCan is sending as response

[Unhandled promise rejection: TypeError: undefined is not an object (evaluating 'b64.length')]
at node_modules\base64-js\index.js:23:15 in getLens
at node_modules\base64-js\index.js:55:20 in toByteArray
at node_modules\react-native-fetch-api\src\StreamArrayBufferResponse.js:6:23 in constructor
at node_modules\react-native-fetch-api\src\Fetch.js:243:35 in __didCompleteNetworkResponse

Oops, I missed one comment in here
Agent.query in react native not fetching properly - Developers - Internet Computer Developer Forum (dfinity.org)

Now we are down to WebAssembly issues