kalidokit icon indicating copy to clipboard operation
kalidokit copied to clipboard

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'createTexture')

Open KJZH001 opened this issue 1 year ago • 7 comments

Link to the test: https://kalidokit-live2d.glitch.me/

Here's the link to the test I deployed on my own server: https://kalidokit.moeworld.top/

(I may have taken it off the server by the time you visit)

Everything else seems to be working fine, both the live2d loading and the camera display

But the motion capture positioning lines and motion capture effects never appear

The error log below is also 100% reproduced in the demo you provided, even in https://kalidoface.com/

How can I solve this problem and I would like to know if this problem is generated on my client (browser) or on the server?

This is the Error Log in my Chrome's console:

face_mesh_solution_simd_wasm_bin.js:9 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'createTexture')
    at __glGenObject (face_mesh_solution_simd_wasm_bin.js:9:215417)
    at _glGenTextures (face_mesh_solution_simd_wasm_bin.js:9:215791)
    at face_mesh_solution_simd_wasm_bin.wasm:0x1451d
    at face_mesh_solution_simd_wasm_bin.wasm:0x14505
    at Object.createTexture (eval at new_ (face_mesh_solution_simd_wasm_bin.js:9:161510), <anonymous>:7:10)
    at pa.h (face_mesh.js:62:503)
    at sa (face_mesh.js:14:299)
    at ta.next (face_mesh.js:15:91)
    at g (face_mesh.js:42:1204)
__glGenObject @ face_mesh_solution_simd_wasm_bin.js:9
_glGenTextures @ face_mesh_solution_simd_wasm_bin.js:9
$func181 @ face_mesh_solution_simd_wasm_bin.wasm:0x1451d
$func180 @ face_mesh_solution_simd_wasm_bin.wasm:0x14505
createTexture @ VM83:7
(anonymous) @ face_mesh.js:62
sa @ face_mesh.js:14
next @ face_mesh.js:15
g @ face_mesh.js:42
Promise.then (async)
Q @ camera_utils.js:22
(anonymous) @ camera_utils.js:22
requestAnimationFrame (async)
P @ camera_utils.js:22
O.a.video.onloadedmetadata @ camera_utils.js:22

The print in my server's cmd:


> [email protected] dev
> vite docs --host 0.0.0.0 "0.0.0.0"


  vite v2.7.1 dev server running at:

  > Network:  http://[the ip I was delete]:3000/
  > Local:    http://localhost:3000/

  ready in 343ms.

16:25:56 [vite] page reload index.html

This is a very interesting project and I spent a long time hoping it would work on my device, but unfortunately I was not able to solve the bug successfully

I hope I can get some help, thanks!

Some content is translated using deepl

KJZH001 avatar Jul 21 '22 09:07 KJZH001

Environment Information

Google Chrome 97.0.4692.99 (正式版本) (64 位) (cohort: Stable Installs & Version Pins)

修订版本 d740da257583289dbebd2eb37e8668928fac5ead-refs/branch-heads/4692@{#1461}

OS Windows 7 Service Pack 1 (Build 7601)

KJZH001 avatar Jul 21 '22 09:07 KJZH001

This seems like an incompatibility of Mediapipe on your device specifically. I am unable to reproduce that error on MacOS.

You could also try other browsers like Edge or Firefox to see if it works on them.

You may need to switch to tensorflow.js version of facemesh to support browsers on all devices. It is slower but has more support.

yeemachine avatar Jul 26 '22 16:07 yeemachine

This seems like an incompatibility of Mediapipe on your device specifically. I am unable to reproduce that error on MacOS.

You could also try other browsers like Edge or Firefox to see if it works on them.

You may need to switch to tensorflow.js version of facemesh to support browsers on all devices. It is slower but has more support.

Thank you for your reply, I will download a firefox to try to re-run the demo, if it does not work I will go to update my chrome to try again But I think Edge is not necessary to try, because edge and Chrome use the same kernel, there should not be any difference in running javascript I will reply later after testing

KJZH001 avatar Jul 28 '22 04:07 KJZH001

Now I have finished the test But the results are not good On Firefox, once I press the button to start the camera on https://kalidoface.com/, the whole firefox goes into an unresponsive state and seems to be unrecoverable I also updated chrome to try this, but the same error occurs as before I think I should probably try switching to tensorflow.js, but since I'm not very familiar with Nodejs, could you give me a general idea of what I need to do?

Now Environment

Google Chrome 103.0.5060.134 (正式版本) (64 位) 修订版本 8ec6fce403b3feb0869b0732eda8bd95011d333c-refs/branch-heads/5060@{#1262} 操作系统 Windows 7 Service Pack 1 (Build 7601) JavaScript V8 10.3.174.20

KJZH001 avatar Jul 28 '22 07:07 KJZH001

I have recently done some other tests I installed firefox on my Android phone and opened https://kalidoface.com/ with it. In live2d mode, the face capture was normal, but it didn't capture my hand movements My personal guess is that only 3d models support full motion capture, which is obvious, but it seems that due to network problems, my side can't load 3d models properly, so I can't verify my guess

KJZH001 avatar Aug 08 '22 13:08 KJZH001

At the same time, I noticed that it doesn't seem to work properly on Via Browser, opening it without any authorization request and issuing a message that the camera is not authorized. And the page rendering doesn't look normal Personally, I think this is probably due to the fact that Via is using the WebView kernel that comes with the system. Also, what does Mediapipe's support have to do with it? Is it the graphics card?

KJZH001 avatar Aug 08 '22 13:08 KJZH001

Could you please reply to me earlier if you have time? It's been ten days.

KJZH001 avatar Aug 08 '22 13:08 KJZH001

Well, okay.

Although you haven't given me a reply until now, and I haven't found out what the problem is.

But after replacing my computer with a new one, I found that both the core and Nvidia discrete graphics cards work fine for this project, so maybe it's solved.

KJZH001 avatar Oct 01 '22 09:10 KJZH001