TypeError: document.exitPointerLock is not a function ...

My game is online at https://spiritualwar.games/otd/g/index.html . It seems to work fine on a PC, but NOW, lately, on a phone or tablet, after getting to the end of the tutorial screen just before transferring to the first map, I get an error starting with

TypeError: document.exitPointerLock is not a function. (In 'document.exitPointerLock()'.'document.exitPointerLock' is undefined)

I don't know how to debug this on Safari on an Ipad - like where is the F12 function? But this looks like a system type error because it is not part of code that i wrote. Can anyone help me? It is tedious to make new versions and upload them just flying in the dark about what might be wrong - because it works for a PC through the browser and it works running the RPG Maker MZ software itself.
You can open your project in e.g. Visual Studio Code and then look for "document" and/or "exitPointerLock" over all your js files, including RPG Maker core files and ALL your plugins, not only the ones that you implemented but also 3rd party. This maybe gives you a hint about what went wrong.
When I disable the CutieVirus MZ3D plugin and the Visustella Battle Core plugins the problem goes away (at https://spiritualwar.games/otd/gb/index.html) but obviously functionality is limited in this case. Not sure which of the 2 is causing the problem.
Does the 3D plugin use mouse-look or something like that? The error is about this:
It might be that the browser throwing the error does not support the HTML5 Pointer Lock API. However, according to that link, iOS Safari supports exitPointerLock from v10.3 onwards (2017) so I doubt that's it...

Maybe it's something to do with browser permissions?
Does the 3D plugin use mouse-look or something like that? The error is about this:
It might be that the browser throwing the error does not support the HTML5 Pointer Lock API. However, according to that link, iOS Safari supports exitPointerLock from v10.3 onwards (2017) so I doubt that's it...

Maybe it's something to do with browser permissions?
Having renabled the BattleCore and it works I found out something must be going wrong with the MZ3D plugin which probably does use this. The 3D plugin used to work on a mobile device, but now it doesn't.

Now I'm trying to avoid having to maintain 2 different versions of my game - one for devices like phones and one for PCs. It would help to be able to switch off the 3D plugin if a game switch was set indicating this is a mobile device. But I can't see how to do that. There are notemap tags like <mz3d> disable() </mz3d> but I don't know how to make their execution conditional upon a switch.

I have to face the fact that on mobiles 3D is slow and also the interactive elements I use to accept keystroked and user input don't always work as well and need to be coded as a special case.
That makes sense. MZ3D does a lot on the graphical layer. You may want to post a message into their thread https://forums.rpgmakerweb.com/index.php?threads/mv3d-3d-rendering-for-rmmv-with-babylon-js.114971/ that you have troubles on mobile given your 3rd party plugins.

Instead of a toggle switch, I recommend deploying your project 2 times, one with MZ3D enabled and one with it to be disabled. Until you find a better solution.
yeah the problem is it is still very much under development so everything would need to be done twice.

Original thread: https://forums.rpgmakerweb.com/threads/typeerror-document-exitpointerlock-is-not-a-function.152675/