Uncaught ReferenceError: loadjs is not defined after drupal core upgrade 9.5.1

Created on 24 January 2023, almost 2 years ago
Updated 24 July 2024, 4 months ago

Problem/Motivation

After drupal core upgrade 9.5.1. I am getting Uncaught ReferenceError: loadjs is not defined in site. This is breaking other js in the site. This js defined in core.libraries.yml file.

Steps to reproduce

See #30

TL;DR:
If any script uses

"use strict";
(function(window, document, Drupal, $) {
  // Your code here
})(window, document, Drupal, jQuery);

instead of

(function(window, document, Drupal, $) {
  "use strict";
  // Your code here
})(window, document, Drupal, jQuery);

and JS aggregation is enabled, this happens!

Proposed resolution

Ensure loadjs is available in global scope, make core more robust for the described case.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

๐Ÿ› Bug report
Status

Needs work

Version

11.0 ๐Ÿ”ฅ

Component
Ajaxย  โ†’

Last updated about 1 hour ago

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia ashetkar

Live updates comments and jobs are added and updated live.
  • JavaScript

    Affects the content, performance, or handling of Javascript.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

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.

Production build 0.71.5 2024