Uncaught TypeError: Word is not a constructor
Submitted by kbaskar on Thu, 09/15/2022 - 06:25
Forums:
In some servers, the H5P content is not displaying and i am seeing the below error in error console.
In some servers, the H5P content is not displaying and i am seeing the below error in error console.
Navigation
Connect with H5P
About
H5P is a registered trademark of H5P Group
Privacy policy |
Copyright ©
2024
BV52
Tue, 09/20/2022 - 18:20
Permalink
Hi kbaskar,I think one of the
Hi kbaskar,
I think one of the main reasons why Oliver asked you to post your concern in the bugs forum so that you will provide more information as requested. So would you mind providing the followng:
If it worked before:
The more information you provide, the quicker the community will be able to fix it and the quicker you'll have a working solution!
-BV
otacke
Wed, 09/21/2022 - 10:11
Permalink
Hi!The "other" reason is that
Hi!
The "other" reason is that the "Developer forum" is for developer discussions, hence the description "Technical forum about Content Type or System Plugin development."
Best,
Oliver
kbaskar
Fri, 09/23/2022 - 09:16
Permalink
I have mentioned all the details in the attachment
Hi Oliver,
I have explained all the details in the attachment and attached the h5p package also, please check the same.
kbaskar
Fri, 09/23/2022 - 09:24
Permalink
I have explained all the details below,
Hi Oliver,
Please find my comments below,
1. Detailed steps to reproduce the bug (exactly how and when did it happen)
--Now we have migrated the application to new server, after that the package is not working, before it was worked in old server. Both servers are on premise server. 2.Platform and version number. E.g. Drupal, Wordpress, Moodle.--Moodle 3. Mobile or Desktop--It is not working on both. 4.Browser: Chrome, Firefox, Safari etc--Chrome 5.H5P plugin version--2020061500 6.H5P content type and version (if a content type was used), and a sample URL or attached H5P.--I have attached the package that i used. 7.Any browser console errors-- We received a error called "Uncaught TypeError: Word is not a constructor" 8.Any PHP errors--No php error 9.Screenshots if it's a visual problemPlease find the attachment. If it worked before:1.Any recent changes to the environment (new plugins/modules, updates, configuration changes etc.)2.Any recent changes to the browser you're using (new extensions, updates etc.)---Recently we moved the application to new server. Seems after this migration, this package is not working. We checked with some other test servers, it is working there.otacke
Fri, 09/23/2022 - 13:54
Permalink
Hi kbaskar!You say "Now we
Hi kbaskar!
You say "Now we have migrated the application to new server, after that the package is not working, before it was worked in old server". It is very likely that this is the root of your problem.
The message "Word is not a constructor" means that the `Word` class doesn't get instantiated, which is quite weird as it's part of the content type which itself seems to work. The only reasons that I can think of is that either the word.js file might be missing or cannot be loaded (in that case you'd see a red entry in the network tab of the browser's development tools) or that the respective entry in the database for the MarkTheWords library doesn't list it. Might have been a migration issue - and you don't describe how that migration took place.
As you can see at https://app.Lumi.education/run/WggBr0 your content works just fine on a platform where everything was installed properly.
You could try to download the MarkTheWords demo content and to upload that on the faulty moodle instance, but you will have to set the H5P plugin for moodle into development mode temporarily, please see https://h5p.org/node/1295120 for an explanation. Not sure if re-uploading a library is possible on moodle's custom H5P integration though (in case you're using that one) that was not created by the H5P core team.
Best,
Oliver
kbaskar
Wed, 11/23/2022 - 13:23
Permalink
Hi Otacke,I followed these
Hi Otacke,
I followed these steps and resolved the issue.
https://www.youtube.com/watch?v=dFDBtmapSSg&t=11s
otacke
Wed, 11/23/2022 - 15:47
Permalink
So you whiped all libraries
So you whiped all libraries in the database just to re-install Mark The Words!? Gee ...
kbaskar
Wed, 11/23/2022 - 16:33
Permalink
Yes, when you update the h5p
Yes, when you update the h5p activity, the libraries will get update automatically.
otacke
Wed, 11/23/2022 - 17:41
Permalink
Not all of them. Only those
Not all of them. Only those that come along with the library that you uploaded.
kbaskar
Wed, 11/23/2022 - 13:26
Permalink
The issue has been fixed.
Hi,
I followed these steps and fixed the issue.
https://www.youtube.com/watch?v=dFDBtmapSSg&t=11s
kbaskar
Wed, 11/23/2022 - 17:48
Permalink
Yes, you have to update the
Yes, you have to update the remaining packages to update the library.
otacke
Wed, 11/23/2022 - 21:54
Permalink
Just wanted to leave the note
Just wanted to leave the note that deleting entries in the database can be dangerous, so you should only do that if you know what you are doing. Don't want to stop you if you wanna do it. Have fun. But maybe tell others that things may break! You're showing to delete every library entry including old minor versions that may still be required and cannot be obtained by uploading the latest release files.