Uncaught ReferenceError: Sortable is not defined

Created on 19 June 2025, 14 days ago

Problem/Motivation

Hi!

Just installed the module to test as a replacement of select2. Found this error when changing from select2 to tagify one facet that already exists.
when the view with the facet loads, i get the error:
Uncaught ReferenceError: Sortable is not defined (tagify-widget.js:142:9)
Going to that line in modules/tagify_facets/js/tagify-widget.js

        /**
         * Binds Sortable to Tagify's main element and specifies draggable items.
         */
        Sortable.create(tagify.DOM.scope, {
          draggable: `.${tagify.settings.classNames.tag}:not(tagify__input)`,
          forceFallback: true,
          onEnd() {
            tagify.updateValueByDOMTags();
          },
        });

checking hte definition in its libraries.yml, we dont see there core/sortable nor in the definition of the JS

Steps to reproduce

Enable both modules
Add a facet with tagify
see the console inspector of the browser

Proposed resolution

I have tried to add 'core/sortable' to tagify_facets.libraries.yml and then Sortable to the JS in lines 7 and 183 after once, but did not worked for me.
So i ended commenting lines 139-148 and the facet worked as expected.
Could be the Sortable was left there by mistake and is not needed?

🐛 Bug report
Status

Active

Version

1.2

Component

Code

Created by

🇧🇪Belgium gorkagr

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024