Title: Main JS error
Last modified: December 20, 2022

---

# Main JS error

 *  [sekedus](https://wordpress.org/support/users/sekedus/)
 * (@sekedus)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/main-js-error/)
 *     ```wp-block-code
       Uncaught TypeError: Cannot read properties of null (reading 'querySelector')
       ```
   
 * ㅤ
 * See screenshot below [👇](https://emojipedia.org/backhand-index-pointing-down/)
 * ![](https://i0.wp.com/i.postimg.cc/pTtr1rzs/CR4S7D.png?ssl=1)
 * ㅤ
 * edited code [⌊👇⌉](https://emojipedia.org/backhand-index-pointing-down/)
 *     ```wp-block-code
       const wrapper = document.querySelector("#ash-dragable-hook-panel");
       if (wrapper) {
         const header = wrapper.querySelector(".ash-show-move-window");
   
         function onDrag({movementX, movementY}){
           let getStyle = window.getComputedStyle(wrapper);
           let leftVal = parseInt(getStyle.left);
           let topVal = parseInt(getStyle.top);
           wrapper.style.left = ${leftVal + movementX}px;
           wrapper.style.top = ${topVal + movementY}px;
         }
   
         header.addEventListener("mousedown", ()=>{
           header.classList.add("ash_active");
           header.addEventListener("mousemove", onDrag);
         });
   
         document.addEventListener("mouseup", ()=>{
           header.classList.remove("ash_active");
           header.removeEventListener("mousemove", onDrag);
         });
       }
       ```
   

The topic ‘Main JS error’ is closed to new replies.

 * ![](https://ps.w.org/another-show-hooks/assets/icon-256x256.png?rev=2769972)
 * [Another Show Hooks](https://wordpress.org/plugins/another-show-hooks/)
 * [Support Threads](https://wordpress.org/support/plugin/another-show-hooks/)
 * [Active Topics](https://wordpress.org/support/plugin/another-show-hooks/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/another-show-hooks/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/another-show-hooks/reviews/)

## Tags

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

 * 0 replies
 * 1 participant
 * Last reply from: [sekedus](https://wordpress.org/support/users/sekedus/)
 * Last activity: [3 years, 5 months ago](https://wordpress.org/support/topic/main-js-error/)
 * Status: not resolved