Avoid "Uncaught ReferenceError: Drupal is not defined" for anonymous users

Created on 4 September 2024, about 1 year ago

Problem/Motivation

We are getting a JS error "Uncaught ReferenceError: Drupal is not defined" in the countdown JS file for anonymous users that visit a page with a countdown block.

Proposed resolution

Add core/drupal dependency to the countdown library.

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇨🇾Cyprus alex.bukach

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

Comments & Activities

  • Issue created by @alex.bukach
  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • Assigned to arijit acharya
  • Issue was unassigned.
  • Status changed to RTBC about 1 year ago
  • Hello,
    I have reviewed the issue. I have installed the 8.x-1.10 release of the module. And found the error reported by alex bukach exists. I applied the patch given by alex bukach and found the error getting resolved. Attaching screenshot for convenience.
    Before patch

    After patch

    Looks good to me. Moving it to RTBC.

  • Assigned to mahyarss
  • Status changed to Fixed 9 days ago
  • 🇵🇱Poland mahyarss

    This issue has been resolved in the 8.x-1.11 release (major refactor).

    The module has been completely refactored with proper Drupal dependencies:

    - All JavaScript libraries now include core/drupal dependency
    - New CountdownTimer library with proper dependency management
    - Tested with anonymous users - no errors

    Fixed in commit: [commit hash]

    Thanks @alex.bukach for reporting this issue!

  • 🇵🇱Poland mahyarss

    Closing as fixed in 8.x-1.11.

    The release is now available at:
    https://www.drupal.org/project/countdown/releases/8.x-1.11

    If you experience this issue after updating, please reopen or create a new issue.

Production build 0.71.5 2024