question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uncaught TypeError: Cannot read property 'src' of undefined

See original GitHub issue

image

new autoComplete({
        selector: "#search-address",
        threshold: 1,
        debounce: 100,
        data: {
            src: async function () {
                const source = await  fetch("https://suggestions.com/test", {
                    method: "POST",
                    mode: "cors",
                    headers: {
                        "Content-Type": "application/json",
                        "Accept": "application/json",
                        "Authorization": "Token " + window.tokenDaData
                    },
                    body: JSON.stringify({ query: $("#search-address").val() })
                });
                const data = await source.json();
                return data.suggestions;
            },
            key: ["unrestricted_value"],
            cache: false
        },
        resultsList: {
            maxResults: 10
        },
        onSelection: (feedback) => {
            selectSuggestion(feedback.selection.value);
        },
    });
<script src="https://cdn.jsdelivr.net/npm/@tarekraafat/autocomplete.js@9.0.5/dist/js/autoComplete.min.js"></script>

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
vodnicearvcommented, May 11, 2021

there was a conflict with this library: https://github.com/Pixabay/JavaScript-autoComplete

0reactions
TarekRaafatcommented, May 11, 2021

Thanks, @vodnicearv for your kind feedback.

I would appreciate it if you could share any details on that conflict maybe there is something that could be done to avoid it in future releases.

Cheers! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught TypeError: Cannot read property 'src' of undefined
I am trying to implement a slide show, I have written following code but it's not working most probably due to the reason...
Read more >
Uncaught TypeError: Cannot read property 'src' of undefined
Hi, I am having a problem when select a variable option and product reload a variable image it caught error : Uncaught TypeError:...
Read more >
TypeError: Cannot read properties of undefined (reading 'src')
If an error occurs after a random number of trials then there is probably either a blank row at the bottom of your...
Read more >
Error in render: "TypeError: Cannot read property 'src' of ...
Hi I use vue-easy-lightbox component inside Vue module and it works perfectly. When I open modal with product data from the shop, ...
Read more >
Cannot Read Property of Undefined in JavaScript - Rollbar
TypeError: Cannot read property of undefined occurs when a property is read or a function is called on an undefined variable.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found