Javascript error: Cannot read properties of undefined (reading 'cookiesjsr')

Created on 18 January 2023, over 2 years ago
Updated 26 January 2023, over 2 years ago

I just upgraded to 1.2.2 via composer, ran the database updates and cleared the cache.

The cookie popup no longer appears and there is the following error in the Javascript console:

Uncaught TypeError: Cannot read properties of undefined (reading 'cookiesjsr')
    at cookiesjsr.conf.js?v=9.4.8:9:48
    at cookiesjsr.conf.js?v=9.4.8:32:3

It is referring to line 9 in cookiesjsr.conf.js:

document.cookiesjsr = drupalSettings.cookies.cookiesjsr;

When I type 'drupalSettings.cookies' into the JS console, it is undefined.

When I change the line of code to the following, it works and the cookie popup appears:

document.cookiesjsr = drupalSettings.cookiesjsr;

🐛 Bug report
Status

Closed: works as designed

Version

1.2

Component

Code

Created by

🇬🇧United Kingdom littledynamo

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.

  • Status changed to Postponed: needs info over 2 years ago
  • Status changed to Closed: works as designed over 2 years ago
  • 🇬🇧United Kingdom littledynamo

    Thanks for looking into this. It does appear to be some kind of caching issue as the problem is no longer present. I suspect maybe a CDN or Varnish issue as I had already cleared the Drupal cache several times.

    Thank you,

    John

  • 🇩🇪Germany Grevil

    Great to hear and glad I could (kinda) help! :)

Production build 0.71.5 2024