Introducing ReUI:Open-source UI components and apps built with React, Next.js and Tailwind CSS
Browse ReUI

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 (5)


Glad you found the solution. Please let us know if you have any issues.

Thanks



Hello Faizal, I'm getting same error. Can you please help me to get rid of that error. I'm getting "Uncaught TypeError: Cannot read properties of null (reading 'addEventListener')" error even if I created assets according to your tutorial video about building assets.
When I delete header search, the errors goes too. Here you can check the example: http://usubaliev.com/satis/



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!



Hi, I'm getting same error. Where is that tutorial which helped you to solve the problem?


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  :(