This error appeared in the console for me when using the Flag module with clientside_validation installed:

VM3499:21 Uncaught TypeError: Cannot read property 'messages' of undefined
at :21:24
at :71:3
........

At the time I was editing a node and clicking on the button to report a flag.

This does not cause an actual problem unless javascript files are aggregated.

If javascript files are aggregated then this error prevents to open the modal dialog form from appearing.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mahesh.umarane created an issue. See original summary.

avpaderno’s picture

Issue tags: -Clientside Validation console
nikunjkotecha’s picture

@Mahesh

Please apply patch from https://www.drupal.org/project/drupal/issues/1988968 and share exact steps to reproduce.

maximkashuba’s picture

The error happens when the library `cv.jquery.validate` is added by BigPipe and compressed.
I just disabled the library compressing in hook_library_info_alter as:


/**
 * Implements hook_library_info_alter().
 */
function clv_coupons_commerce_library_info_alter(&$libraries, $extension) {
  // During JS compressing the library is added
  // by BigPipe with errors, hence disable the compressing.
  // @see https://www.drupal.org/project/clientside_validation/issues/3211333
  if (isset($libraries['cv.jquery.validate']['js']['js/cv.jquery.validate.js'])) {
    $libraries['cv.jquery.validate']['js']['js/cv.jquery.validate.js']['preprocess'] = FALSE;
  }
}

now it works.

poindexterous’s picture

Patch #234 for issue 1988968 helped me with this issue. the errors in the console were also preventing CKeditor in a layout builder popup module from rendering. I'm running drupal 9.2.7

drupalninja99’s picture

I am experience the same exact issue with layout builder

gnuget’s picture

#4 worked for me.

Thanks!

liam morland’s picture

Version: 3.0.0-rc4 » 3.0.x-dev
Status: Postponed (maintainer needs more info) » Needs review

We were having this problem. It was preventing CKEditor from loading in Layout Builder blocks. We added the hook implementation in #4 to one of our modules and that fixed it for us.

The problem also went away if we disabled clientside_validation_jquery.

lukassykora made their first commit to this issue’s fork.

andikanio’s picture

Just wanted to inform that when you suddenly got this error on May 2024.
It was caused by this https://community.cloudflare.com/t/jsdelivr-expired-certificate-may-2024...

jsdelivr SSL Expired, should be changed into other cdn.
the config should be located in /admin/config/user-interface/clientside-validation-jquery-settings

nikunjkotecha’s picture

Version: 3.0.x-dev » 4.0.x-dev
Status: Needs review » Needs work

Please raise MR against 4.0.x (last development branch)