VibeDict

🧩Name not defined

What you'll see
ReferenceError: useState is not defined

A name (variable or function) used in the code can't be found anywhere. Usually an import is missing or there's a typo.

🤔 Why does it happen?

  • An import is missing (for example, useState wasn't imported from react)
  • The name has a typo or different capital letters
  • Something that only exists in the browser (window, document) was used on the server

🔧 Try this

  1. Check that the name is in the import lines at the top of the file
  2. Check the spelling and capital letters
  3. If window or document is the cause, make that code run only in the browser

🤖 Ask your AI like this

I get the ReferenceError below. Please find the missing import or typo and fix it. If the cause is a browser-only feature like window or document, change it so it only runs in the browser. [Paste the full error here]

Replace the [ ] parts with your own situation, and paste the error with a few extra lines before and after it.

Related terms

Other errors in this group