KeymanWeb Keyboard is not funcitoning php

We have integrated your keymanweb on our portal. It was working fine for few days and now suddenly stopped working with the remote JS “https://s.keyman.com/kmw/engine/12.0.105/keymanweb.js” and throwing an error as below:

utils.ts:113 Uncaught TypeError: Cannot read property ‘Window’ of null
at Function.e.instanceof (utils.ts:113)
at Function.e.instanceof (utils.ts:101)
at a. (kmwdomevents.ts:193)
at HTMLSpanElement.handler (jquery.min.js:2)
at HTMLSpanElement.dispatch (jquery.min.js:2)
at HTMLSpanElement.v.handle (jquery.min.js:2)
at Object.trigger (jquery.min.js:2)
at HTMLSpanElement. (jquery.min.js:2)
at Function.each (jquery.min.js:2)
at k.fn.init.each (jquery.min.js:2)

@joshua_horton can you help on this?

I see here that you’re using remote JS for version 12. I assume that this is still the case?

Investigating the error log you’ve copied here, we saw a similar error during development of version 13, which was released to stable about a week ago. Could you try using remote JS “https://s.keyman.com/kmw/engine/13.0.100/keymanweb.js” and see if the issue persists?

Hi Joshua,

Sure. Let me try it once. Do we always have to use remote js? Can’t we download and use it locally? I tried but because it is loading some more remote js, did not work.

Thanks

Rahul Anand

It is still not working. I can’t see the tigrinya keyboard on our website https://tigrinya.afiteq.com/. When you choose tigrinya from the search box drop down, it was working fine before.

HI Joshua,

It is still not working. You can see this on our website https://tigrinya.afiteq.com/. When you change the dropdown value to “English” or “Tigrinya” it should change the keyboard accordingly but it is not working.

Thanks

Rahul Anand

While it is still “not working”, it appears the error messages have disappeared; I don’t get the error log you reported above when I visit the site.

Instead, I get errors regarding some of the other local code… though admittedly, yes, the keyboard doesn’t show. Looking at your code, I can see a few points for some guidance. From line 796 on your index page:

var kmw = keyman;
kmw.init({attachType:'auto'});
kmw.addKeyboards('@en','@ti');
kmw.osk.hide();
if($(".s_drop").val()=="3"){
  kmw.setActiveKeyboard('gff_tir_er_7','ti');
  kmw.osk.hide();
}else{
  kmw.setActiveKeyboard('english','en');
  kmw.osk.hide();
}

While I can’t speak to exactly how things were working before, I’d like to point out that your code is making a very large assumption here - in particular, that the specific keyboards you want will be returned from an API call on just the language codes. Unfortunately, this is currently not happening - neither for the ‘en’ or the ‘ti’ codes. This may be partly our fault; we’ve recently noted some issues with how keyboards are returned from API calls that likely effected this situation. There’s also the fact that we’ve marked all current Web keyboards for Tigrinya as deprecated, which means they’re generally not returned from our language-code-only API calls.

To ensure you always get the specific keyboards you want, please note the documentation at https://help.keyman.com/DEVELOPER/ENGINE/WEB/13.0/guide/adding-keyboards. Following the format specified at the very bottom, I would suggest modifying your addKeyboards line as follows:

kmw.addKeyboards('kbdus@en','gff_tir_er_7@ti');

or

kmw.addKeyboards('sil_euro_latin@en', 'gff_tir_er_7@ti');

Since there is no plain ‘english’ keyboard for ‘en’, I’d suggest picking one of those two as the English keyboard id for your site.

Then again… it looks like that keyboard isn’t being returned; looks like a recent adjustment to our keyboard API may have been a bit overzealous. @Marc_Keyman, it looks like deprecated keyboards are now never returned by the API, even if a deprecated keyboard is specifically requested. While this is probably fine for general, language-code only requests, this breaks pages that rely on specific keyboards once they are deprecated.

Yes, I see this. Apologies. I have opened an issue about this and will hopefully address this later this week (travelling at present so limited capacity).

I admit I am puzzled as to why we are no longer offering a Tigrinya keyboard – or is it buried under a different BCP 47 code (e.g. ti-er or similar)?

Hi,

I tried with the given suggestion


kmw.addKeyboards('kbdus@en','gff_tir_er_7@ti');

or


kmw.addKeyboards('sil_euro_latin@en', 'gff_tir_er_7@ti');

but it is still not working and throwing a “404 js”: error. Please find the attached. Please provide us a solution to make it work again

Thanks

Rahul Anand

Hi,

I tried with the given suggestion

kmw.addKeyboards('kbdus@en','gff_tir_er_7@ti');

or

kmw.addKeyboards('sil_euro_latin@en', 'gff_tir_er_7@ti');

but it is still not working and throwing a “404 js”: error. Please provide us a solution to make it work again

404 JS - https://api.keyman.com/cloud/4.0/keyboards?jsonp=keyman.register&languageidtype=bcp47&version=13.0.100&keyboardid=sil_euro_latin@en,gff_tir_er_7@ti&timerid=236

Thanks

Rahul Anand

We are working on resolving the error with downloading the Tigrinya keyboard. We have a potential fix and it is being checked now and will hopefully be published today.

We’ve published the fix; the URL you provided is working now. Are things working correctly for you?