scripts.bundle.js:7 Error: Uncaught TypeError: Cannot read properties of null (reading 'addEventListener')
Hi! I'm new to this theme, I installed Laravel on my new and fresh website, but I'm using the HTML ver. from this theme and apply the theme manually by copying the design I need. It was okay, until I realized my console was showing the error Uncaught TypeError: Cannot read properties of null (reading 'addEventListener') in scripts.bundle.js:7, how do I fix this?
Oh, my project is still working fine even though the error still there, I just don't want the error to show up in the console.
Thank you in advance.
Hi Fathul Husnan,
The error seems too general. Could you please send the screenshot of the console log? Please try to expand the error for more details and file paths.
I found the cause of the error! It's because I didn't build the js script like in the video tutorial, I just copied the script.bundle.js and other scripts from demo1, but I removed the "advanced search" from the theme, so the script couldn't find the elements.
Thanks for the reply! I'll try to follow the tutorial first (I don't know if there are video tutorial before) and will ask again when I get into a slump!
Glad you found the solution. Please let us know if you have any issues.