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.

Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (3)

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.

Thanks

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.

Thanks

Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(