There is an error in H5P.SoundJS-1.0 that is exposed by various js minimization functions whether advagg or even Drupal core js aggregation.

This line has an error...

a.ABSOLUTE_PATT=/^(?:\w+:)?\/{2}/i,a.RELATIVE_PATT=/^[./]*?\//i,a.EXTENSION_PATT=/\/?[^/]+\.(\w{1,5})$/i

and should instead escape the two bracketed / like this...

a.ABSOLUTE_PATT=/^(?:\w+:)?\/{2}/i,a.RELATIVE_PATT=/^[.\/]*?\//i,a.EXTENSION_PATT=/\/?[^\/]+\.(\w{1,5})$/i

How do we fix that? I think H5P.SoundJS-1.0 is just a utility library used by other libraries.

Comments

webservant316 created an issue. See original summary.

webservant316’s picture

Okay looks like a problem with jsmin on the H5P content types Interactive Chart and Interactive Multiple Choice. I will be looking for a way to turn off AdvAgg on H5P content types as a solution.

Any other ideas?

paalj’s picture

It would be interesting to know:
- Which JavaSscript errors you see
- Which files jsmin are messing up

webservant316’s picture

How do I get that information from the failed page? I am using FF with Firebug installed. Will that help?

webservant316’s picture

Temporary solution over here https://www.drupal.org/node/2803335.

paalj’s picture

In Firefox you should select Tools -> Web Developer -> Web Console (from the menu bar), and see if there are any errors displayed. If so, please paste them here.

webservant316’s picture

When using jsmin on Interactive chart

SyntaxError: illegal characterjs__e1z-ZH5keOIV-1pM9aU8ciIezIj0TqTNftIrHQjnYhc__jq5uGDV40ABxf7ssNXc2QLXgyoM74bfW80fKxkWBpHA__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:146:247
Unable to find constructor for: H5P.Chart 1.0js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:91:101
H5P.error()js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:91
H5P.newRunnable()js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:79
H5P.init/$containers<()js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:26
.each()js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:2
b.prototype.each()js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:2
H5P.init()js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:24
js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:172
b.Callbacks/c()js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:2
b.Callbacks/p.fireWith()js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:2
.ready()js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:2
H()js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:2

TypeError: instance is undefined
H5P.on()
js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:144
H5P.init/$containers<()
js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:33
.each()
js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:2
b.prototype.each()
js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:2
H5P.init()
js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:24

js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:172
b.Callbacks/c()
js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:2
b.Callbacks/p.fireWith()
js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:2
.ready()
js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:2
H()
js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:2
js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:144:1
Use of getPreventDefault() is deprecated. Use defaultPrevented instead.

When using jsmin on Interactive Multiple Choice

SyntaxError: missing ; before statementjs__XtOHGJc3obasGTEvfq3_E65OEkI3VVFNmwOEDoL4678__Bw4RqlWxPJYNX8bGNlYgp81ANWR8hVs0Z8Ti2undqSs__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:9:113
Unable to find constructor for: H5P.MultiChoice 1.6js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:91:101
H5P.error()js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:91
H5P.newRunnable()js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:79
H5P.init/$containers<()js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:26
.each()js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:2
b.prototype.each()js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:2
H5P.init()js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:24
js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:172
b.Callbacks/c()js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:2
b.Callbacks/p.fireWith()js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:2
.ready()js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:2
H()js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:2

TypeError: instance is undefined
H5P.on()
js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:144
H5P.init/$containers<()
js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:33
.each()
js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:2
b.prototype.each()
js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:2
H5P.init()
js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:24

js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:172
b.Callbacks/c()
js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:2
b.Callbacks/p.fireWith()
js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:2
.ready()
js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:2
H()
js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:2
js__XafR-NkxLBJydpSmXkQSlRswx2PpO39P0U8PncFCX_k__Ae06AFcTCHQql9UfaINdgT7Z4L_WywKcwqeBcm9M3G4__jKNFuLkK_YOo_kpCGxGpBVasN1QUZy0B9e839xeUYiE.js:144:1
Use of getPreventDefault() is deprecated. Use defaultPrevented instead.

paalj’s picture

I had hoped the error message would give a clue about what is wrong, but unfortunately that was not the case.

Since you have found a solution to this, and it is not related to the H5P module (but one or moer of the H5P content types), I suggest you close this issue.

webservant316’s picture

Title: Advanced Aggregation and Interactive Chart and Multiple Choice » Js Aggregation and Interactive Chart and Multiple Choice
Category: Support request » Bug report

I am no longer using project/advagg and now still have the same problem with the native Drupal Js aggregator. I am thinking there is a bug in some H5P Js.

I will private message the maintainer a webpage that demonstrates the problem.

paalj’s picture

I have taken a look at the files you sent, and it seems the aggregation fails for h5p-soundjs. I get "Uncaught SyntaxError: Invalid regular expression: missing /" in the console, and see that parts of soundjs is gone.

We have no problems with this on h5p.org, which is using the native Drupal aggrgation. Are you using the latest Drupal version?

webservant316’s picture

Yes, I am using Drupal 7.56 and jQuery_update 7.x-2.7 with the jquery version set to 1.8.

webservant316’s picture

anything else I can provide to debug this problem?

webservant316’s picture

This issue may be relevant https://www.drupal.org/node/2898779#comment-12208517.

I am trying to see how the soundjs code gets installed. I am guessing it is part of one of the H5P libraries.

webservant316’s picture

Title: Js Aggregation and Interactive Chart and Multiple Choice » H5P.SoundJS-1.0 error impacting Js Aggregation of Interactive Chart and Multiple Choice

This line has an error...

a.ABSOLUTE_PATT=/^(?:\w+:)?\/{2}/i,a.RELATIVE_PATT=/^[./]*?\//i,a.EXTENSION_PATT=/\/?[^/]+\.(\w{1,5})$/i

and should instead escape the two bracketed / like this...

a.ABSOLUTE_PATT=/^(?:\w+:)?\/{2}/i,a.RELATIVE_PATT=/^[.\/]*?\//i,a.EXTENSION_PATT=/\/?[^\/]+\.(\w{1,5})$/i

How do we fix that? I think H5P.SoundJS-1.0 is just a utility library used by other libraries.

webservant316’s picture

Issue summary: View changes
paalj’s picture

webservant316: Kudos to you for finding the cause of this problem, we really appreciate it! It is strange we are not seeing this on our sites, but that regexp certainly looks strange.

The h5p-soundjs library is using 0.6.0 of the soundjs library. I see the regexp has been fixed in version 0.6.1. The solution will be to update the h5p library to use the latest stable version of this external javascript. Hopefully, I will be able to provide you a new version today!

paalj’s picture

Assigned: Unassigned » paalj
Status: Active » Needs work
paalj’s picture

I have updated the H5P.SoundJS library, but not released it yet. I would like you to test it first, since I am not able to reproduce. The new version is available here: http://fnoks.joubel.com/html/h5p-soundjs-1.0.2.h5p. Could you please:

  • Upload it to your site (//your-site/admin/content/h5p)
  • Delete the cache
  • Test if it works

Let me know how it goes

webservant316’s picture

I uploaded "Sound js api (1.0.2)" and it works. I can turn on Drupal core javascript aggregation and the H5P question types still work.

Thanks!

BTW credit for the find goes to @mikeytown2 at https://www.drupal.org/node/2898779.

paalj’s picture

Super! Thanks for letting us know. The new version of H5P.SoundJS is now released: h5p.org/post-hub-releases

paalj’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.