After enabling the aggregate and compress CSS files , H5P editor not loaded

Hi , 

I have used the H5P plugin in my drupal site. After enabling the aggregate and compress CSS files , H5P editor not loaded .

I found one error in console " window.js:10 Uncaught ReferenceError: EJS is not defined".

Anyone know the reason ?

How to track the issue in aggregate and compress CSS files ?

 

In console below is listed:  siles/default/files/js/node_modules/global/window.js

if (typeof window !== "undefined") {

    module.exports = window;

} else if (typeof global !== "undefined") {

    module.exports = global;

} else if (typeof self !== "undefined"){

    module.exports = self;

} else {

    module.exports = {};

 

}

 

Content types: 
icc's picture

Have you been using the NPM command or NodeJS? Do you have a package.json file inside the sites/default/files/js folder? It sounds like you might have another module that causes issues when aggregation is turned on. 

I don't have package.json file inside the sites/default/files/js folder, inside this folder only aggregation js files are there. I included the ejs.js file in our site. May be the ejs files are not aggregated properly . I added the "drupal_add_js("/sites/default/files/ejs.js", array('preprocess' => FALSE));Then only the h5p editor loaded properly. Is this is correct fix?

icc's picture

Where is the ejs.js coming from? Neither the H5P Hub or the H5P Editor uses EJS.

Ejs.js file located inside the folder h5p/libraries/EmbeddedJS-1.0/js/ejs.js

icc's picture

That EJS is used for a couple of the content types and is not part of the editor. There must be something else on the page including it.

clearing browser cache will resolve the issue. It worked for us, so give it a shot.