- 🇨🇦Canada nikathone Ontario
I am not sure that this error is related to this one but after doing a google and issue search I found this is closest one with what I am facing.
Mine looks likeUncaught TypeError: Cannot read properties of null (reading 'add') at e.initADA (slick.min.js?v=1.x:1:19335) at e.init (slick.min.js?v=1.x:1:19101) at new <anonymous> (slick.min.js?v=1.x:1:2832) at i.fn.slick (slick.min.js?v=1.x:1:42781) at doSlick (slick.load.js?v=9.5.2:296:7) at nn (dblazy.min.js?rpbwad:1:2287) at N.once (dblazy.min.js?rpbwad:1:8063) at Object.attach (slick.load.js?v=9.5.2:321:12) at drupal.js?v=9.5.2:24:24 at Array.forEach (<anonymous>)
It started after updating to the latest Drupal slick 2.7.0 from 2.6.0. The slick js library that I am using didn't change (v1.8.1).
After reading comment #6 I went ahead and updated the module code by applying the following change:
diff --git a/js/slick.load.js b/js/slick.load.js index 9888cca..b20541a 100644 --- a/js/slick.load.js +++ b/js/slick.load.js @@ -10,7 +10,7 @@ var _id = 'slick'; var _unslick = 'unslick'; var _mounted = _id + '--initialized'; - var _element = '.' + _id; + var _element = '.' + _id + ':not(.' + _mounted + ')'; var _elSlider = '.slick__slider'; var _elArrow = '.slick__arrow'; var _elBlazy = '.b-lazy[data-src]:not(.b-loaded)'; diff --git a/slick.libraries.yml b/slick.libraries.yml index 3da6dbd..6b8b80e 100644 --- a/slick.libraries.yml +++ b/slick.libraries.yml @@ -68,7 +68,7 @@ base: slick.load: version: VERSION js: - js/slick.load.min.js: { weight: 0, minified: true } + js/slick.load.js: { weight: 0 } dependencies: - slick/base
and now the error is gone.
I am not providing a patch because I am not sure if the maintainer is onboard with this approach and I couldn't figured out how to re-generate the
slick.load.min.js
file. - Status changed to Active
almost 2 years ago 3:37am 31 January 2023 - 🇨🇦Canada nikathone Ontario
I am re-opening this to make sure that the maintainer see my latest update but they should close it in case they feel like this is an isolated problem. I appreciate all the work for the maintainer(s) put into this module.
- 🇮🇩Indonesia gausarts
I am fine to re-open it if it happened on the 2.7, and we'll mark it a bug or regression, only after reproduction.
But what happened if you stick to the project requirements:
> Slick library (1.6+ and <= 1.8.0)...Important! If any issues with specific number 1.8.0, be sure version in Slick package.json matches the version written in slick.js. The reason, release 1.8.1 with package.json 1.8.1 has also version 1.8.0 written in slick.js as of this writing 2021/10. If they don't match, they are not supported by this module.
Try lowering your version a bit, and let me know?
- 🇨🇦Canada nikathone Ontario
To make sure I understand, I should try slick js library version 1.6+ and <= 1.8.0 with the latest Drupal slick 2.7.0 and report back?
Thanks for the quick feedback.
- 🇨🇦Canada bsuttis
I hit this issue after updating to Slick 8.x-2.7
I can confirm the problem does not exist with 8.x-2.6 and slick.js 1.8.1 but after updating to 8.x-2.7 the problem occurs. I think it's related to the commit referenced in comment #7 (https://git.drupalcode.org/project/slick/-/commit/22fd2e3b8e1203489c023f...).
In particular, the change of:
var _element = '.' + _id + ':not(.' + _mounted + ')';
to:
var _element = '.' + _id;
I applied the patch provided in #7 and the error stopped. I was curious if it was an issue with Slick 1.8.1 so I downgraded the module to 8.x-2-6 but the error still occurred. I think this is an issue with the module code and not the Slick JS library.
- 🇯🇴Jordan mohammedOdeh
After updating to Slick 8.x-2.7 I hit this issue and "play/pause" buttons still appear after disabling the arrows
- Status changed to RTBC
almost 2 years ago 4:01pm 11 March 2023 - 🇭🇺Hungary lonalore Budapest, Hungary
Patch #13 is working fine. Thank you!
- 🇮🇩Indonesia gausarts
Hang on there, which one fixed the OP, #12 and #13? Both?
#13, AFAIK, play/ pause button is not original library's, it is Accessible Slick's and my own custom module's, years before Accessible Slick has it.
@mohammedodeh, if the OP is solved by #12, please move your patch into a separate issue as a Feature for inclusion under the Accessible Slick, currently still marked as a WIP due to conflicting issues, see the open ones.
Thanks.
- Status changed to Fixed
almost 2 years ago 9:43am 12 March 2023 - 🇮🇩Indonesia gausarts
This issue is a mix of custom code, 1.x and 2.x with different source of problems :)
- The custom code, the OP, had been fixed. That is why this issue is set back to Fixed, see the OP and #4.
- Branch 1.x is no longer supported, please upgrade to 2.x.
- For 2.x, simply update Blazy and Slick to their latest, and you will not have this issue. No patches are needed.
Here is the combo that works without issues:
- Blazy <= 2.5 + Slick <= 2.6
- Blazy >= 2.6 + Slick >= 2.7
- At both cases, Slick library v1.6-1.8.0, see project home for details.
- Accessible Slick is still a WIP, please file the issue separately, see #15.
Mismatch of the above combo will cause this particular issue due to core deprecation of jQuery.once which is no longer included in Slick 2.7.
Thanks.
Automatically closed - issue fixed for 2 weeks with no activity.