- Issue created by @camoa
- First commit to issue fork.
- Status changed to Closed: cannot reproduce
over 1 year ago 1:27pm 13 April 2023 - πΊπΈUnited States chrissnyder Maryland
The sitewide_alert module does not use "use strict".
From https://www.drupal.org/project/drupal/issues/3336143 π Uncaught ReferenceError: loadjs is not defined after drupal core upgrade 9.5.1 Needs work it is not recommended to have use strict in the global context.
the init.js file has:
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/'use strict';
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
By having any library that uses loadjs and turning on aggregation, if this fie is loaded first you get an error for loadjs not defined.
According to the Drupal core issue, the solution should be to not have a "use strict" call in the global context.
Closed: cannot reproduce
2.0
Code
The sitewide_alert module does not use "use strict".