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.

results.size is not a function

See original GitHub issue

Hi there,

thanks you for this plugin. I have updated it to version 0.5.0 in my theme but when trying to search I’m getting the following error:

Uncaught TypeError: results.size is not a function at Object.<anonymous> (jquery.ghosthunter.js?v=79caedeb82:3478)

HTML:

<form class="search-form">
	<input type="text" id="search-field" class="search-field" placeholder="Type your keywords&hellip;" />
	<input type="submit" class="search-submit" value="Search" />
</form>
<div id="search-results" class="search-results"></div>

jQuery code:

var searchField = $('#search-field').ghostHunter({
	results : "#search-results",
	onKeyUp : true
});

Can you help to fix it? Thank you.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Windyocommented, Feb 28, 2018

… I did a typo when committing 7e0f675 I did a hotfix just now but I won’t be able to test until this weekend. If you’ve got free time, try the latest commit, otherwise revert to 0.4.0 until I finish ironing this out.

Sorry about this

1reaction
fbennettcommented, Feb 11, 2018

Ah. $().size() is deprecated. Looks like we can just use $().length there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught TypeError: $(...).size is not a function - Stack Overflow
After replacing size() with length , it turned out that the actual problem is reference to non-existnent element. This implies that undefined is ......
Read more >
Uncaught TypeError: $(…).size is not a function - WordPress.org
From the console, activating the lightbox results in the error: Uncaught TypeError: $(…).size is not a function jquery.prettyPhoto.js:193:32.
Read more >
jQuery(...).size is not a function - Feedback - #sentry
size is not a function” and what is bad about that is that it is impossible to reproduce, even if there is no...
Read more >
Result of size() function could not be used in a for loop in ...
I get the number of images a ImageCollection using the size() function, but when I use that number in a for loop, it...
Read more >
.size() | jQuery API Documentation
Description: Return the number of elements in the jQuery object. version added: 1.0.size(). This method does not accept any arguments.
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