Title: Javascript error while using with Print My Blog plugin
Last modified: October 13, 2024

---

# Javascript error while using with Print My Blog plugin

 *  Resolved [Michael Nelson](https://wordpress.org/support/users/mnelson4/)
 * (@mnelson4)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/javascript-error-while-using-with-print-my-blog-plugin/)
 * Hi I’m the developer of another plugin, Print My Blog.
 * A user of mine reported getting an error which actually originated in Hustle’s
   JS code.
 * This is what I saw in my browser’s console, from `hustle-ui.js:formatted:6547:
   60
 *     ```wp-block-code
       Uncaught TypeError: e(...).find(...).filter(...)[0] is undefined    trapFocus hustle-ui.min.js:formatted:6547    slideinLoad hustle-ui.min.js:formatted:5838    setTimeout handler*HUI.slideinLoad hustle-ui.min.js:formatted:5833    showModule front.min.js:1    displayModule front.min.js:1    display front.min.js:1    exitTimer front.min.js:1    setTimeout handler*4859/exit_intentTrigger/this.setExitTimer front.min.js:1    exit_intentTrigger front.min.js:1    Underscore 3    jQuery 11    exit_intentTrigger front.min.js:1    displayOnTrigger front.min.js:1    handleDisplay front.min.js:1    initialize front.min.js:1    View front.min.js:1    s front.min.js:1    s front.min.js:1    1225 front.min.js:1    N Underscore    1225 front.min.js:1    1225 front.min.js:1    i front.min.js:1    <anonymous> front.min.js:1    <anonymous> front.min.js:1    <anonymous> front.min.js:1hustle-ui.min.js:formatted:6547:60
       ```
   
 * It’s a bit hard for me to figure out what’s going on by reading the minimized
   code, but as I read it, the line that’s throwing the error is looking for the
   first button or link it or form input it can find in the popup and then focusing
   on that. That’s handy, but for some reason it’s not finding anything, and then
   indexing into an empty array (hence why it’s saying `...[0] is undefined`). The
   code should be more defensive, and double-check it finds something in the query
   before indexing into it (eg
 *     ```wp-block-code
       var thing_to_focus_on = e(…).find(…).filter(…);if(thing_to_focus_on.length > 0){     thing_to_focus_on.focus();}
       ```
   

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

 *  [Kris – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport13/)
 * (@wpmudevsupport13)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/javascript-error-while-using-with-print-my-blog-plugin/#post-18069923)
 * Hi [@mnelson4](https://wordpress.org/support/users/mnelson4/)
 * I hope you are doing well today.
 * I pinged our Hustle Team to review your query. We will post an update here as
   soon as more information is available. Thank you for your patience while we look
   into this further.
 * Kind Regards,
   Kris
 *  [Kris – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport13/)
 * (@wpmudevsupport13)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/javascript-error-while-using-with-print-my-blog-plugin/#post-18074745)
 * Hi again [@mnelson4](https://wordpress.org/support/users/mnelson4/)
 * We have made some additional tests on our lab site, but as we do not know your
   plugin well and your client site setup (Print My Blog plugin setup mainly) it
   will be hard to point out the main issue.
    1. Can you in the first place replace Hustle core files or re-install Hustle and
       see if the error will be still visible?
    2. Does your client site use any cache plugin that has an assets optimization feature,
       and if so disable that plugin and see if can you still replicate the same error?
    3. Also, just in case, would you please run a conflict test? Please deactivate 
       all plugins except Print My Blog and Hustle and check if the problem is gone.
       If so, then enable all plugins one by one and find which one is having a conflict.
       If there is no positive result, switch to the default WordPress theme like 2019,
       and see if it works. **Before this test, we recommend full site backup or running
       this test on the staging site.**
 * Please let us know about the results.
 * Kind Regards,
   Kris
 *  Thread Starter [Michael Nelson](https://wordpress.org/support/users/mnelson4/)
 * (@mnelson4)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/javascript-error-while-using-with-print-my-blog-plugin/#post-18080555)
 * Hi Kris,
 * thanks for your prompt and detailed reply.
 * I’m not clear: have you made any changes based on my feedback? (The problem being
   some Javascript code that’s calling `focus()` on a query that might not have 
   found anything.) If I had access to your source code I bet I could point out 
   the exact line that’s causing the problem. That’s not available to fellow developers
   somewhere is it?
 * Is what you’re suggesting just standard first steps for all issues reported?
    -  This reply was modified 1 year, 7 months ago by [Michael Nelson](https://wordpress.org/support/users/mnelson4/).
 *  Plugin Support [Patrick – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport12/)
 * (@wpmudevsupport12)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/javascript-error-while-using-with-print-my-blog-plugin/#post-18083739)
 * Hi [@mnelson4](https://wordpress.org/support/users/mnelson4/)
 * I hope you are doing well.
 * The plugin conflict is always the first step, as the title indicated “Javascript
   error while using with Print My Blog plugin” Initially it indicated a conflict
   between Hustle and your plugin [https://wordpress.org/plugins/print-my-blog/](https://wordpress.org/plugins/print-my-blog/),
   so our QA team tested both plugins but it worked well hence why our request.
 * But I did some further tests and the problem isn’t between them, thanks for reporting.
 * The issue occurs indeed when there is no anchor, button, input or text area which
   is rare in the PopUp, usually, we have the close button, regardless of whether
   the Print My Blog is enabled or not.
 * That said, I found the steps to replicate by hiding the close and “Add “Never
   see this message again” link”
 * That script error should not affect any other PopUp functionality but I agree
   it needs to be improved, I see you were able to bypass the issue it was causing
   on your plugin as well [https://wordpress.org/plugins/print-my-blog/#developers](https://wordpress.org/plugins/print-my-blog/#developers)
 * Best Regards
    Patrick Freitas
 *  Plugin Support [Nithin – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport11/)
 * (@wpmudevsupport11)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/javascript-error-while-using-with-print-my-blog-plugin/#post-18108962)
 * Hi [@mnelson4](https://wordpress.org/support/users/mnelson4/),
 * Since we haven’t heard from you for a while. I’ll mark this thread as resolved
   for now. Please feel free to open a new thread if you need any further assistance.
 * Best Regards
   Nithin

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

The topic ‘Javascript error while using with Print My Blog plugin’ is closed to 
new replies.

 * ![](https://ps.w.org/wordpress-popup/assets/icon-256x256.gif?rev=3446944)
 * [Hustle - Email Marketing, Lead Generation, Optins, Popups](https://wordpress.org/plugins/wordpress-popup/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-popup/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-popup/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-popup/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-popup/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-popup/reviews/)

 * 5 replies
 * 4 participants
 * Last reply from: [Nithin – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport11/)
 * Last activity: [1 year, 7 months ago](https://wordpress.org/support/topic/javascript-error-while-using-with-print-my-blog-plugin/#post-18108962)
 * Status: resolved