Failed to load resource, Loading, please wait, add content

Created on 15 July 2022, about 3 years ago
Updated 18 August 2022, almost 3 years ago

Problem/Motivation

console errors:

several like this:
Failed to load resource: net::ERR_NAME_NOT_RESOLVED http://libraries/H5PEditor.TableList-1.0/h5p-editor-table-list.css?ver=1...

4 like this too:
Error while loading script Event http://localhost:8888/modules/contrib/h5p/vendor/h5p/h5p-editor/scripts/...

also seeing errors:
[Warning] [page not found] [client: ::1, admin] /node/17869/unique-id-min.js.map
[Warning] [page not found] [client: ::1, admin] /node/17869/widget-min.js.map
[Warning] [page not found] [client: ::1, admin] /node/17869/autocomplete-min.js.map
[Warning] [page not found] [client: ::1, admin] /node/17869/labels-min.js.map
[Warning] [page not found] [client: ::1, admin] /node/17869/menu-min.js.map

Steps to reproduce

php 8.1
drupal core: 9.4.1
h5p ^2.0@alpha

πŸ› Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jakegibs617

Live updates comments and jobs are added and updated live.
  • PHP 8.1

    The issue particularly affects sites running on PHP version 8.1.0 or later.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • I am also experiencing the same issue:

    Drupal 9.4.13
    PHP 8.0.27
    Version: 2.0.0-alpha3

    Using the Opigno distribution, when I go to add a new Question Set OR when I try to load an existing Question Set I get the following Errors in the console:

    GET https://libraries/H5PEditor.TableList-1.0/h5p-editor-table-list.css?ver=... net::ERR_NAME_NOT_RESOLVED
    GET https://libraries/H5PEditor.RangeList-1.0/h5p-editor-range-list.css?ver=... net::ERR_NAME_NOT_RESOLVED
    GET https://libraries/H5PEditor.ShowWhen-1.0/h5p-show-when.css?ver=1.0.9 net::ERR_NAME_NOT_RESOLVED
    GET https://libraries/FontAwesome-4.5/h5p-font-awesome.min.css?ver=4.5.4 net::ERR_NAME_NOT_RESOLVED
    GET https://libraries/H5PEditor.VerticalTabs-1.3/styles/css/vertical-tabs.cs... net::ERR_NAME_NOT_RESOLVED
    GET https://libraries/H5PEditor.QuestionSetTextualEditor-1.3/dist/question-s... net::ERR_NAME_NOT_RESOLVED

    The functionality for the call is here:
    /modules/contrib/h5p/vendor/h5p/h5p-editor/scripts/h5peditor.js

    This is where the code seems to have issues:

    ns.libraryRequested = function (libraryName, callback) {
      var libraryData = ns.libraryCache[libraryName];
    
      if (!ns.libraryLoaded[libraryName]) {
        // Add CSS.
        if (libraryData.css !== undefined) {
          libraryData.css.forEach(function (path) {
            if (!H5P.cssLoaded(path)) {
              H5PIntegration.loadedCss.push(path);
              if (path) {
                ns.$('head').append('<link ' +
                  'rel="stylesheet" ' +
                  'href="' + path + '" ' +
                  'type="text/css" ' +
                  '/>');
              }
            }
          });
        }
    
        // Add JS
        var loadingJs = false;
        if (libraryData.javascript !== undefined && libraryData.javascript.length) {
          libraryData.javascript.forEach(function (path) {
            if (!H5P.jsLoaded(path)) {
              loadingJs = true;
              ns.loadJs(path, function (err) {
                if (err) {
                  console.error('Error while loading script', err);
                  return;
                }
    

    The libraryData.css & libraryData.javascript for me is the following:
    [
    "//libraries/H5PEditor.TableList-1.0/h5p-editor-table-list.css?ver=1.0.4",
    "//libraries/H5PEditor.RangeList-1.0/h5p-editor-range-list.css?ver=1.0.12",
    "//libraries/H5PEditor.ShowWhen-1.0/h5p-show-when.css?ver=1.0.9",
    "//libraries/FontAwesome-4.5/h5p-font-awesome.min.css?ver=4.5.4",
    "//libraries/H5PEditor.VerticalTabs-1.3/styles/css/vertical-tabs.css?ver=1.3.9"
    ]
    [
    "//libraries/H5PEditor.QuestionSetTextualEditor-1.3/dist/question-set-textual-editor.js?ver=1.3.8",
    "//libraries/H5PEditor.TableList-1.0/h5p-editor-table-list.js?ver=1.0.4",
    "//libraries/H5PEditor.RangeList-1.0/h5p-editor-range-list.js?ver=1.0.12",
    "//libraries/H5PEditor.ShowWhen-1.0/h5p-show-when.js?ver=1.0.9",
    "//libraries/H5PEditor.VerticalTabs-1.3/vertical-tabs.js?ver=1.3.9",
    "//libraries/H5P.QuestionSet-1.17/presave.js?ver=1.17.1"
    ]

    1. The libraryData.css.forEach && libraryData.javascript.forEach is looping through each of these index's
    2. The function H5P.cssLoaded(path) && H5P.jsLoaded(path) (found in web/modules/contrib/h5p/vendor/h5p/h5p-core/js/h5p.js) determines the position of an element in the array (it would return 0-5, and 0-4 respectfully)
    3. The function ns.loadJs (found in web/modules/contrib/h5p/vendor/h5p/h5p-editor/scripts/h5peditor.js) takes in the index we are at in the array, and is creating a new script element.

    My Analysis:
    I believe the ns.loadJs is where our issue occurs.

    I am not sure why.

  • πŸ‡§πŸ‡΄Bolivia vacho Cochabamba

    Same issue on alpha3 version.

  • πŸ‡§πŸ‡΄Bolivia vacho Cochabamba

    I see that patch #11 doesn't works over h5p works, looks that works for a some distribution.

    this patch is for h5p 2.0.0 branch

  • πŸ‡ΊπŸ‡ΈUnited States illeace

    Using Drupal 11 and the latest 2.0.0-alpha6 module, I don't have this issue. In this version at least, this patch doesn't really make sense to me. The order of the params in the current module matches the order expected in the H5P core editor's getLibraryData() function. Changing them breaks the loading of the H5P libraries. It seems like this has either been fixed or perhaps it only happened with the Opigno distribution?

Production build 0.71.5 2024