Unable to find constructor for: H5P.DragText 1.10

Unable to find constructor for: H5P.DragText 1.10

by Philipp Imhof -
Number of replies: 2
Picture of Core developers Picture of Plugin developers

Hello!

We have Moodle 4.5.2 (Build: 20250210) running with the mod_hvp (Interactive Content) plugin. When creating a simple "Drag the words" activity, it does not show up in the browser. Instead, we get the following output in the console:

h5p.js?ver=2024120900:989 Unable to find constructor for: H5P.DragText 1.10
H5P.error	@	h5p.js?ver=2024120900:989
H5P.newRunnable	@	h5p.js?ver=2024120900:908
(anonymous)	@	h5p.js?ver=2024120900:137
each		@	jquery.js?ver=2024120900:2
each		@	jquery.js?ver=2024120900:2
H5P.init	@	h5p.js?ver=2024120900:93
(anonymous)	@	h5p.js?ver=2024120900:2879
e		@	jquery.js?ver=2024120900:2
t		@	jquery.js?ver=2024120900:2
setTimeout		
(anonymous)	@	jquery.js?ver=2024120900:2
c		@	jquery.js?ver=2024120900:2
fireWith	@	jquery.js?ver=2024120900:2
fire		@	jquery.js?ver=2024120900:2
c		@	jquery.js?ver=2024120900:2
fireWith	@	jquery.js?ver=2024120900:2
ready		@	jquery.js?ver=2024120900:2
B		@     	jquery.js?ver=2024120900:2

jquery.js?ver=2024120900:2 jQuery.Deferred exception: Cannot read properties of undefined (reading 'getCopyrights') TypeError: Cannot read properties of undefined (reading 'getCopyrights')
    at H5P.getCopyrights (/mod/hvp/library/js/h5p.js?ver=2024120900:1139:16)
    at HTMLDivElement. (/mod/hvp/library/js/h5p.js?ver=2024120900:174:30)
    at S.each (/mod/hvp/library/js/jquery.js?ver=2024120900:2:2976)
    at S.fn.init.each (/mod/hvp/library/js/jquery.js?ver=2024120900:2:1454)
    at H5P.init (/mod/hvp/library/js/h5p.js?ver=2024120900:93:60)
    at HTMLDocument. (/mod/hvp/library/js/h5p.js?ver=2024120900:2879:11)
    at e (/mod/hvp/library/js/jquery.js?ver=2024120900:2:30005)
    at t (/mod/hvp/library/js/jquery.js?ver=2024120900:2:30307) undefined  

Does anyone have an idea why this is happening and how to resolve it? Drag the Words is already updated to the current release (1.10.17).

Thanks in advance & best regards

Average of ratings: -
In reply to Philipp Imhof

Re: Unable to find constructor for: H5P.DragText 1.10

by Philipp Memmel -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Hi,

I'm not 100% sure if that is the same error, but we had trouble with updating libraries the last time and ran into similar errors. It seemed that during the update which we triggered manually from inside a h5p activity as admin the library somehow got broken. We fixed it by manually decreasing the patch version column of the respective library in the hvp_libraries table so we could update the library again in the frontend as admin.

Maybe this helps!

Philipp 

In reply to Philipp Imhof

Unable to find constructor for: H5P.DragText 1.10

by Anton Tremetzberger -
Picture of Particularly helpful Moodlers
Hi,

Even though this post is a while old, we’re having a similar problem and our hosting provider (many thanks to him) has found a solution for us: "the cause was an outdated cache that contained information about how to display this content, but had been created at a time when the necessary technical components had not yet been fully installed. The system continued to use this outdated cache every time the page was loaded, instead of creating an updated one. You can resolve this issue by deleting the hvp-specific "cachedassets" from the mdl_files directory, thereby forcing the system to recreate them."

This is the SQL query. However, there is no guarantee; use at your own risk: DELETE FROM mdl_files WHERE component = 'mod_hvp' AND filearea = 'cachedassets'

PS. we are using Moodle 4.5.8 and H5P-Plugin (1.27.2, 2024120900), we do not use the "Core"-H5P.

br, Anton