No modal on drupal 10 site

Created on 26 October 2023, 8 months ago

Hello,

Sorry for just posting a support request issue, but I've been trying to get this module to work on our site that was recently updated to Drupal 10, but have had no luck getting the modal to show on any pages. Here's what I've done:

I added the ouibounce.js and ouibounce.min.js files to /webserver/web/libraries/ouibounce. I also tried using npm install ouibounce while in /webserver, so hopefully the library is installed correctly. If I did something wrong, please let me know where I should be putting the files or where I should be running the npm install (and please update the installation section with this info as I did my best based on the very limited info there).

After adding the library files, I used composer require 'drupal/ouibounce_exit_modal:^4.0@RC', again in /webserver, and then installed the module via the Drupal Extend interface. After that, I checked the status report and saw no issues with the module, so I added the ouibounce block to the Content section of the block layout and configured with some test HTML and set it to be as aggressive as possible for testing, but have yet to see the modal show even once on any page.

Please let me know if you have any questions or need any additional information. I'd really like to get this working as this module has many features I like and I haven't been able to find any good alternatives.

(Also I tried both 4.0rc2 as well as 4.x-dev and had the same results for both. I'd really like to use the new mobile device features if possible!)

Update: I confirmed that the script is loading properly, and the ouibounce-exit-modal element is indeed appearing on the page, but using the debugger, it seems like "ouibounce" is always coming through as undefined.

Drupal.behaviors.initOuibounce = {
    attach: function (context, settings) {
      once('init-ouibounce', document.getElementById('ouibounce-exit-modal'), context).forEach(function (item) {
        if (typeof ouibounce !== "undefined") {   // <=== this is showing up as undefined always
πŸ’¬ Support request
Status

Active

Version

4.0

Component

Miscellaneous

Created by

πŸ‡ΊπŸ‡ΈUnited States rolfl

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @rolfl
  • πŸ‡ΊπŸ‡ΈUnited States rolfl

    Update: I confirmed that the script is loading properly, and the ouibounce-exit-modal element is indeed appearing on the page, but using the debugger, it seems like "ouibounce" is always coming through as undefined.

    Drupal.behaviors.initOuibounce = {
        attach: function (context, settings) {
          once('init-ouibounce', document.getElementById('ouibounce-exit-modal'), context).forEach(function (item) {
            if (typeof ouibounce !== "undefined") {   // <=== this is showing up as undefined always
    
  • πŸ‡ΊπŸ‡ΈUnited States rolfl

    Update: I confirmed that the script is loading properly, and the ouibounce-exit-modal element is indeed appearing on the page, but using the debugger, it seems like "ouibounce" is always coming through as undefined.

    Drupal.behaviors.initOuibounce = {
        attach: function (context, settings) {
          once('init-ouibounce', document.getElementById('ouibounce-exit-modal'), context).forEach(function (item) {
            if (typeof ouibounce !== "undefined") {   // <=== this is showing up as undefined always
    
  • πŸ‡ΊπŸ‡ΈUnited States rolfl
Production build 0.69.0 2024