wenzhixin / multiple-select

A jQuery plugin to select multiple elements with checkboxes :)
http://multiple-select.wenzhixin.net.cn
MIT License
1.9k stars 652 forks source link

Uncaught TypeError: Cannot read properties of undefined (reading 'locales') #618

Open HThuren opened 5 months ago

HThuren commented 5 months ago

@wenzhixin When trying to use locale, I get the Uncaught TypeError: Cannot read properties of undefined (reading 'locales')

Do you have an idea to help this out ?

You find

        import './jquery';
    import 'jquery-ui/dist/jquery-ui';
    import 'jquery-textcomplete';
    import 'jquery-touchswipe';
    import select2 from 'select2';
    select2(jQuery);
    import 'multiple-select';
    import 'multiple-select/dist/multiple-select-locale-all.js';
    import '../../libraries/jquery.nouislider.all.min.js';
    import '../../libraries/jquery.flightindicators.js';

where import of import 'multiple-select/dist/multiple-select-locale-all.js'; give the typeerror.

Comment out import 'multiple-select/dist/multiple-select-locale-all.js'; remove the issue, but then no translation.

This won't help

    import multipleSelect from 'multiple-select';
    multipleSelect('destroy');

either this

import multipleSelect from 'multiple-select';
multipleSelect('init');
import 'multiple-select/dist/multiple-select-locale-all.js';

If you want, you can get the code at https://github.com/betaflight/betaflight-configurator/pull/3756.