$view undefined on attached view or other ajax

Created on 28 January 2021, over 3 years ago
Updated 15 February 2024, 4 months ago

I get a $view undefined js error intermittently depending on perhaps the speed and order in which ajax events take place.

I have an attached view using the infinite scroll, so maybe 1 is completing an ajax event sooner?
I'm also using an exposed form and other ex: ajaxComplete.

Wrapping the 'infiniteScrollInsertView' in a promise seems to resolve the issue.

    $.when(Drupal.views.instances[currentViewId]).done(function (x) {
      // Get the existing ajaxViews object.
      var view = Drupal.views.instances[currentViewId];

      .  .  .

      // Run views and VIS behaviors.
      Drupal.attachBehaviors(view.$view[0]);
    });
πŸ› Bug report
Status

Postponed: needs info

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States devitate Orange County, CA

Live updates comments and jobs are added and updated live.
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.69.0 2024