Consistent uncaught error in ToolbarVisualView

Created on 27 April 2022, about 3 years ago

Problem/Motivation

I am seeing the following JavaScript Uncaught TypeError: on every page load...

Uncaught TypeError: Cannot read properties of undefined (reading 'ToolbarVisualView')
    at ToolbarVisualView.js?v=9.3.12:12:18
    at ToolbarVisualView.js?v=9.3.12:23:3

Can anyone help poinpoint what might be the cause of that?

Thank you

πŸ› Bug report
Status

Active

Version

4.4

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom SirClickALot Somerset

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.

  • πŸ‡ΈπŸ‡ͺSweden ordermind

    For me the issue stemmed from the fact that ToolbarVisualView.js from the responsive_menu module was loaded before ToolbarVisualView.js from the toolbar module, whereby the ToolbarVisualView object has not been created yet at the time that the responsive_menu script tries to access it. I was able to solve it for myself by adding a hook_library_info_alter hook with a conditional library dependency on toolbar/toolbar if the toolbar module is enabled.

  • πŸ‡¬πŸ‡§United Kingdom SirClickALot Somerset

    Hi @ ordermind β†’ ,

    Finally, an answer - brilliant, thank you!

    Would you be able share that little snippet of hook code here please then I'll be able to confirm its effectiveness too.

  • πŸ‡¦πŸ‡ΊAustralia jordan.jamous

    Upgrade to 4.4.5
    The issue has been fixed in #404945
    Commit: https://git.drupalcode.org/project/responsive_menu/-/commit/e1b5013e4345...

      version: VERSION
      js:
        js/views/ToolbarVisualView.js: {}
    +  dependencies:
    +   - toolbar/toolbar
    
Production build 0.71.5 2024