JS - Uncaught Error: missing source

Please report bugs here!

Moderator: Thorsten

Post Reply
Victor
Posts: 2
Joined: Thu Dec 22, 2016 1:12 pm

JS - Uncaught Error: missing source

Post by Victor »

Hello!

Just installed PMF 2.9.5 and got JS error on blank installation:

phpmyfaq.min.js:16 Uncaught Error: missing source
at Function.error (phpmyfaq.min.js:16)
at new c (phpmyfaq.min.js:34)
at e (phpmyfaq.min.js:34)
at Object.map (phpmyfaq.min.js:16)
at a.c (phpmyfaq.min.js:34)
at new a (phpmyfaq.min.js:34)
at HTMLInputElement.m (phpmyfaq.min.js:35)
at Function.each (phpmyfaq.min.js:16)
at ea.fn.init.each (phpmyfaq.min.js:16)
at ea.fn.init.initialize (phpmyfaq.min.js:35)


As I understood problem connected with a search on header. when I removed search from header in template this error message disappeared.

Thank you for your help!
Victor
Posts: 2
Joined: Thu Dec 22, 2016 1:12 pm

Re: JS - Uncaught Error: missing source

Post by Victor »

The error connected with Typeahead. I took phpmyfaq.js ver 2.9.1 and it works fine. BTW on your demo version 2.9.1 version is using not 2.9.5

Line: 17986

ver 2.9.5

Code: Select all

        

    // instantiate the typeahead UI
    $('.typeahead').typeahead(null, {
        display: 'suggestion',

        templates: {
            notFound: [
                '<div class="empty-message">',
                'Nothing found... :-(',
                '</div>'
            ].join('\n'),
            suggestion: Handlebars.compile(
                '<div><strong>{{category}}</strong>: <a href="{{url}}">{{question}}</a></div>'
            )
        }
    }).on('typeahead:selected typeahead:autocompleted', function () {
        $('#searchfield').submit();
    });
});
ver 2.9.1

Code: Select all

    });
[b]    // initialize the bloodhound suggestion engine
    questions.initialize();[/b]
    // instantiate the typeahead UI
    $('.typeahead').typeahead(null, {
        display: 'suggestion',
[b]        source: questions.ttAdapter(),[/b]
        templates: {
            empty: [
                '<div class="empty-message">',
                'unable to find any Best Picture winners that match the current query',
                '</div>'
            ].join('\n'),
            suggestion: Handlebars.compile(
                '<div><strong>{{category}}</strong>: <a href="{{url}}">{{question}}</a></div>'
            )
        }
    }).on('typeahead:selected typeahead:autocompleted', function () {
        $('#searchfield').submit();
    });
});
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: JS - Uncaught Error: missing source

Post by Thorsten »

Hi,

thanks, it's alreay fixed for 2.9.6

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply