Uncaught TypeError: Cannot read properties of undefined (reading 'name')

Created on 29 November 2023, 7 months ago
Updated 19 December 2023, 6 months ago

Problem/Motivation

Console Error showing after switching stylesheet

Steps to reproduce

1. Install module
2. Add one stylesheet and place styleswitcher block
3. Now try to change the stylesheet from styleswitcher block
4. Check console of browser. You'll see error

Proposed resolution

Add empty check for style variable in JS file

🐛 Bug report
Status

Postponed: needs info

Version

2.0

Component

Code

Created by

🇮🇳India vishal.kadam Mumbai

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

Comments & Activities

  • Issue created by @vishal.kadam
  • Status changed to Needs review 7 months ago
  • Status changed to Needs work 6 months ago
  • 🇺🇦Ukraine pingwin4eg Zaporizhia 🇺🇦

    Hi @vishal.kadam . First of all, thanks for reporting this.

    Unfortunately, I can't reproduce the bug in a "fresh" installation. You should provide more context.

    As for your patch, it just prevents the error in console, but doesn't fix it. You click a link in a block, but a style is not changing, if I understand correctly.

    I suggest you to try the latest dev version of the module in your installation, and report back. If the error still exists, please provide more details - which browser, drupal core version, other installed modules, anything that might help reproduce it.

  • Status changed to Postponed: needs info 6 months ago
  • 🇺🇦Ukraine pingwin4eg Zaporizhia 🇺🇦
Production build 0.69.0 2024