Uncaught TypeError: a.indexOf is not a function
at r.fn.init.r.fn.load (jquery.min.js?v=3.2.1:4)
at Object.attach (scripts.js?v=8.4.0:1)
at Object.Drupal.attachBehaviors (drupal.js?v=8.4.0:25)
at drupal.init.js?v=8.4.0:16
at HTMLDocument.t (ready.min.js?v=1.0.8:4)

CommentFileSizeAuthor
#24 screenshot.PNG176.06 KBvitaliych
#24 issue.txt18.56 KBvitaliych
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

denisomerovic created an issue. See original summary.

denisomerovic’s picture

Issue summary: View changes
catch’s picture

Status: Active » Postponed (maintainer needs more info)

Could you confirm which contrib modules are in use, especially advagg (and if so whether it's up to date?).

denisomerovic’s picture

I don't think it's a module issue. Drupal 8.4 comes with jquery 3 and jquery 3 doesn't allow load() function. I think i get this error as soon as i installed drupal 8.4

catch’s picture

So this is a new clean install of 8.4? Not an update from 8.3?

xjm’s picture

@denisomerovic, we need to know what modules or custom code you have that's causing this error, i.e. what is calling the load() method. Probably something is incompatible with jQuery 3, but to our knowledge core itself has had all its JS updated to be compatible. So we need steps to reproduce, or what modules are installed.

xjm’s picture

Issue tags: +8.4.0 update
denisomerovic’s picture

Yeah, clean install not an upgrade. In my modules folder i have admin_toolbar, colorbox, contact_block, ctools, devel, module_filter, pathauto, svg_image, token.

cilefen’s picture

@denisomerovic Which of those modules is installed?

denisomerovic’s picture

@cilefen all of them.

denisomerovic’s picture

I tested again fresh installation of Drupal 8.4.0. Also i installed base theme https://www.drupal.org/project/basic and once i uncomment scripts.js it shows the error. So this is probably something with basic theme?

kevinquillen’s picture

Project: Drupal core » Basic
Version: 8.4.0 » 8.x-1.x-dev
Component: configuration system » Code

See: https://jquery.com/upgrade-guide/3.0/#breaking-change-load-unload-and-er...

The scripts.js file contains a call to .load().

kevinquillen’s picture

Status: Postponed (maintainer needs more info) » Active
kevinquillen’s picture

denisomerovic "Basic" is not a base theme from Drupal, it is a contributed theme and has been moved to its project issue queue.

denisomerovic’s picture

Status: Active » Fixed

@kevinquillen that's right, the theme calls a .load(). so instead it should go
$(window).on('load', function () {

});

Now the errors are gone. Thanks

kevinquillen’s picture

Status: Fixed » Active

Well, its not "fixed" because this can happen to anyone who downloads Basic and is using 8.4.x+. It should be resolved here.

xjm’s picture

Title: Drupal 8.4 Jquery » Drupal 8.4 requires jQuery 3, which no longer supports load()

Clarifying title. Thanks for confirming it's being caused by the Basic theme.

denisomerovic’s picture

Thank you all.

joelpittet’s picture

Status: Active » Fixed

Thanks, I've committed changes to remove those functions in favour of on('event'

  • joelpittet committed a12229b on 8.x-1.x
    Issue #2915944 by denisomerovic, kevinquillen, xjm, catch, cilefen:...

  • joelpittet committed 03bec2d on 8.x-2.x
    Issue #2915944 by denisomerovic, kevinquillen, xjm, catch, cilefen:...
leahtard’s picture

Thanks for the fix Joel! I have 8.x-1.3 queued up for release.

Cheers, Leah

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

vitaliych’s picture

FileSize
18.56 KB
176.06 KB

I have installed fresh drupal 8.4.2 got few modules and themes everything seams to work fine
but when i'm trying to use editor in any case editing custom block or content for example trying to insert picture i'm getting similar error message

drupal.js:13 Uncaught TypeError: $context.find(...).once is not a function
at initFileValidation (:15:33)
at Array.forEach ()
at Object.attach (:20:31)
at Object.Drupal.attachBehaviors (drupal.js:25)
at Drupal.AjaxCommands.insert (ajax.js:516)
at Drupal.Ajax.success (ajax.js:407)
at Object.success (ajax.js:222)
at i (jquery.min.js:2)
at Object.fireWith [as resolveWith] (jquery.min.js:2)
at A (jquery.min.js:4)

What should i do about it , how to fix the issue?

denisomerovic’s picture

I don't think that is related to this issue but try add under dependencies - core/jquery.once in your theme.libraries.yml file.
Something like this below.

  dependencies:
    - core/jquery
    - core/jquery.once
krishnaveni.t’s picture

@denisomerovic

Thanks.
#25 Worked well.

tapas_talukder’s picture

I have change the jQuery(window).load() to jQuery(document).ready() function and its working fine.
Actually on jquery 3 and 3+ version does not support load function.