Common browser errors

  • TypeError: Cannot read properties of null → element not in DOM yet; check ID / script order
  • ERR_CONNECTION_REFUSED → no server on that port; check if the server is running
  • CORS policy blocked → server missing Access-Control-Allow-Origin header
  • React key warning → list items need stable unique key prop for efficient updates
  • TS: string | undefined not assignable to string → handle the undefined case before assigning

Question 0 of 5

The browser console shows: TypeError: Cannot read properties of null (reading 'addEventListener'). What is the most likely cause?