选择ajax内容

I can not cope with the solution of this problem. The content of the problem:

select2.full.js:4025 Uncaught TypeError: Cannot read property 'slice' of undefined
at DecoratedClass.HidePlaceholder.removePlaceholder (select2.full.js:4025)
at DecoratedClass.removePlaceholder (select2.full.js:594)
at DecoratedClass.HidePlaceholder.append (select2.full.js:4008)
at DecoratedClass.append (select2.full.js:594)
at Select2. (select2.full.js:1025)
at Select2.Observable.invoke (select2.full.js:651)
at Select2.Observable.trigger (select2.full.js:641)
at Select2.trigger (select2.full.js:5489)
at select2.full.js:5348
at Object.options.transport.self.trigger.message (select2.full.js:3482)

What am I doing wrong?

$(document).ready(function(){

$('#select2').select2({
               minimumInputLength:1,
               width: '300px',
               placeholder:"Select Parent Menu",
                ajax: {
                    type:"get",
                    url: "../test/inc/ajax/ajaxlux.php",
                    dataType: 'json',
                    quietMillis: 100,
                    data: function(params) {
                        return {
                            query: params.term, //search term
                            page_limit: 10 // page size 
                            
                        };
                        console.log(data);
                    },

        results: function(data) {
                        var newData = [];
                        for ( var i = 0; i < data.length; i++ ) {
                            newData.push({
                                id: item.FormID  //id part present in data
                                , text: item.FormName  //string to be displayed
                            });
                        }
                        return { results: newData };
                    },

                }
            });
  });
<select id="select2">

</select>';

And ajaxlux.php:

    $sql = "
SELECT ".$prefix."product.product_id,".$prefix."product.product_name
FROM ".$prefix."product 
WHERE ".$prefix."product.product_name LIKE '%".$_GET['query']."%'
AND ".$prefix."product.product_active = '1'
ORDER BY product_name ASC  LIMIT 10 " ;

    $result= mysqli_query($link,$sql) or die(mysqli_error());       

     $json = [];
    while($row = mysqli_fetch_assoc($result)){   
         $json[] = array (
            'FormID' => $row['product_id'],
            'FormName' => $row['product_name'],

        );
    }
    echo json_encode($json, JSON_UNESCAPED_UNICODE ); 

}

I looked through many sites on the internet and the same code as my work for someone else.

</div>

this is how I had to set up mine to get it to work:

        $('#select2').select2({
            minimumInputLength:1,
            width: '300px',
            placeholder:"Select Parent Menu",
            ajax: {
                type:"get",
                url: "../test/inc/ajax/ajaxlux.php",
                dataType: 'json',
                quietMillis: 100,
                data: function(params) {
                    return {
                        query: params.term, //search term
                        page_limit: 10 // page size 

                    };
                    console.log(data);
                },

                processResults:  function(data) {
                    newData =    $.map(data, function (ind, item ) {
                        item.id = item.FormID;
                        item.text = item.FormName;
                        return item;
                    } );

                    return { results: newData };
                },

            }
        });