Uncaught JS TypeErrors after Update to Version 2.1 or 2.2

Created on 19 May 2023, about 1 year ago
Updated 12 July 2023, 12 months ago

Problem/Motivation

I have a Drupal 9 Website, which is running fine with Paragraphs Editor Enhancements 2.0.x and Paragraphs Features 1.16.x.
Now the modules should be updated for Drupal 10 compatibility.

Steps to reproduce

Once I update to Paragraphs Editor Enhancements 2.1.x (or 2.2.x) and Paragraphs Features 2.0.x, Paragraphs EE is not working any more.
I get errors in my browsers console:

Uncaught TypeError: Cannot read properties of undefined (reading 'add_in_between')
at Object.attach (paragraphs-features.add-in-between.js?ruwol2:121:50)
at drupal.js?v=9.5.9:24:24
at Array.forEach ()
at Drupal.attachBehaviors (drupal.js?v=9.5.9:21:34)
at drupal.init.js?v=9.5.9:24:12
at HTMLDocument.listener (drupal.init.js?v=9.5.9:14:7)

Uncaught TypeError: $dialog_parent is not a function
at HTMLDivElement. (paragraphs_ee.categories.js?ruwol2:63:15)
at Function.each (jquery.min.js?v=3.6.3:2:3003)
at E.fn.init.each (jquery.min.js?v=3.6.3:2:1481)
at HTMLDivElement. (paragraphs_ee.categories.js?ruwol2:59:24)
at Function.each (jquery.min.js?v=3.6.3:2:3003)
at E.fn.init.each (jquery.min.js?v=3.6.3:2:1481)
at Object.attach (paragraphs_ee.categories.js?ruwol2:54:57)
at drupal.js?v=9.5.9:24:24
at Array.forEach ()
at Drupal.attachBehaviors (drupal.js?v=9.5.9:21:34)

Any help is welcome.
Thank you.

πŸ› Bug report
Status

Fixed

Version

2.1

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany MikeZ77

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.

  • πŸ‡ΊπŸ‡¦Ukraine Sash1n

    Just a typo in js

  • Status changed to Closed: outdated about 1 year ago
  • πŸ‡©πŸ‡ͺGermany stBorchert

    Thanks for testing.
    Branch 2.2.x is not tested against Drupal 9 yet (and maybe will not be compatible to Drupal 9 at all) and is under heavy development. So it's better to not use it right now with Drupal 9.
    I will update the core version requirement so it is not installable in Drupal 9 until I have tested and verified it.

  • πŸ‡©πŸ‡ͺGermany MikeZ77

    Thank you for the patch, it solves the latter TypeError ("$dialog_parent is not a function") but not the first one ("Cannot read properties of undefined (reading 'add_in_between'").

    So I will go back to 2.0 and re-install 2.1 once I am upgrading to D10.

  • Status changed to Needs work about 1 year ago
  • πŸ‡©πŸ‡ͺGermany stBorchert

    Oh sorry, I misread the issue and thought it only happens in 2.2.x. But you also said 2.1.x, so it should be fixed there.

  • Hi!

    I had the same error and the patch worked but I also have another console error:

    Uncaught TypeError: The element must be an instance of Element

    I've been trying to find another patch or something to fix this but there's nothing available right now.

    I did some debug for this and found that the problem is in the following function:

    Drupal.ajax.bindAjaxLinksWithProgress = function (element)

    I'm pasting here the full console error:

    Uncaught TypeError: The element must be an instance of Element
        at u (once.js:122:11)
        at i (once.js:156:25)
        at a (once.js:280:5)
        at augmentedOnce (jquery.once.bc.js?v=9.5.9:26:12)
        at Drupal.ajax.bindAjaxLinksWithProgress (paragraphs_ee.admin.js?rwko5d:223:5)
        at Drupal.paragraphs_features.add_in_between.initParagraphsWidget (paragraphs_ee.admin.js?rwko5d:120:19)
        at paragraphs-features.add-in-between.js?rwko5d:123:53
        at NodeList.forEach (<anonymous>)
        at paragraphs-features.add-in-between.js?rwko5d:122:58
        at Array.forEach (<anonymous>)
    

    Maybe it's a conflict with the once.js library?

    • 14334bb9 committed on 2.1.x
      Issue #3361500 by Sash1n: Uncaught JS TypeErrors after Update to Version...
  • πŸ‡§πŸ‡ͺBelgium JeroenT πŸ‡§πŸ‡ͺ

    This issue was committed so I guess we can close it now?
    https://git.drupalcode.org/project/paragraphs_ee/-/commit/14334bb9ab0c5e...

  • Status changed to Fixed 12 months ago
  • πŸ‡§πŸ‡ͺBelgium JeroenT πŸ‡§πŸ‡ͺ
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024