Title: Javascript TypeError when clicking Process All Posts
Last modified: November 13, 2020

---

# Javascript TypeError when clicking Process All Posts

 *  Resolved [squarestar](https://wordpress.org/support/users/squarestar/)
 * (@squarestar)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/javascript-typeerror-when-clicking-process-all-posts/)
 * I’m working on a local site, so I can’t provide a link.
 * When I click process all posts I get: `Uncaught TypeError: can't access property"
   length", chunk is undefined`.
 * This happens when Relevanssi Light is the only plugin active (though I do have
   posts in my database of post types from other plugins).
 * Using latest version of WP and Relevanssi Light. I have added the filter for 
   boolean mode but made no other customisations
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fjavascript-typeerror-when-clicking-process-all-posts%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * (@msaari)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/javascript-typeerror-when-clicking-process-all-posts/#post-13658271)
 * That would happen if Relevanssi Light fetches the posts, but doesn’t actually
   get any posts.
 * It’s easy to fix the error so that it doesn’t happen and I will do that, but 
   it won’t remove the actual cause of this error, which is that the `relevanssi_light_get_chunks()`
   function in `relevanssi-light-admin-ajax.php` tries to fetch posts with `get_posts()`
   but for some reason doesn’t get any.
 * If you want to debug this further, I would look at what that function is doing.
   Why is the `get_posts()` there not getting any results? It’s looking for all 
   posts with `post_status` of `publish` – do you perhaps have no posts of the `
   post` post type? That could be one explanation.
 *  Thread Starter [squarestar](https://wordpress.org/support/users/squarestar/)
 * (@squarestar)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/javascript-typeerror-when-clicking-process-all-posts/#post-13658387)
 * Thanks for responding. I do have content that is published, but only of a custom
   post type. After adding `'post_type' => 'any'` to the `$args` for `get_posts()`
   in that function, the process worked without error
 *  Plugin Author [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * (@msaari)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/javascript-typeerror-when-clicking-process-all-posts/#post-13658416)
 * That’s an oversight in the code, I’ll add that `any` in there. Thanks!
 *  Thread Starter [squarestar](https://wordpress.org/support/users/squarestar/)
 * (@squarestar)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/javascript-typeerror-when-clicking-process-all-posts/#post-13658458)
 * Thanks! Much appreciated 🙂

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Javascript TypeError when clicking Process All Posts’ is closed to new
replies.

 * ![](https://ps.w.org/relevanssi-light/assets/icon-256x256.png?rev=3529521)
 * [Relevanssi Light](https://wordpress.org/plugins/relevanssi-light/)
 * [Support Threads](https://wordpress.org/support/plugin/relevanssi-light/)
 * [Active Topics](https://wordpress.org/support/plugin/relevanssi-light/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/relevanssi-light/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/relevanssi-light/reviews/)

## Tags

 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [typeerror](https://wordpress.org/support/topic-tag/typeerror/)

 * 4 replies
 * 2 participants
 * Last reply from: [squarestar](https://wordpress.org/support/users/squarestar/)
 * Last activity: [5 years, 6 months ago](https://wordpress.org/support/topic/javascript-typeerror-when-clicking-process-all-posts/#post-13658458)
 * Status: resolved