$ is not defined Browser Origin: On your device Last updated 15 Oct 2026

Console: Uncaught ReferenceError: $ is not defined (jQuery not loaded or loaded after your code)

Your code uses jQuery's $ before jQuery has loaded — the script is missing, blocked, in the wrong order, or loaded async/defer after your code.

Exact message you may see Uncaught ReferenceError: $ is not definedReferenceError: $ is not definedjQuery is not definedReferenceError: jQuery is not definedUncaught TypeError: $ is not a function
Seen on: Chrome Firefox JavaScript WordPress

Meaning

Scripts run in order. If your inline code or app.js comes before the jQuery <script>, or the jQuery file fails to load (404, blocked CDN, CSP, offline), $ and jQuery are undefined. Check the Network tab to see whether jQuery loaded at all.

Common causes

  • jQuery <script> placed after the code that uses it
  • jQuery file 404, blocked by CSP/adblocker, or the CDN is down
  • async or defer changing execution order
  • A plugin loaded before jQuery
  • Two incompatible jQuery versions (noConflict)

⚡ Quick fix

  1. Load jQuery first, then plugins, then your code
  2. Check the Network and Console tabs for a failed jQuery request
  3. Wrap code in $(document).ready only after jQuery is present

Detailed fix by platform

JavaScript

  1. <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script> then <script src="app.js"></script> (or use defer on both so order is kept)
  2. Debug: console.log(typeof jQuery)

WordPress

  1. Use wp_enqueue_script('my-js', ..., array('jquery')) and write jQuery(function($){ ... }) — WordPress runs jQuery in noConflict mode

How to diagnose

  1. Order — Which script comes first?
  2. Load — Did the jQuery request succeed?
  3. Mode — noConflict / WordPress?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: On your device. Errors that are often confused with or caused by this one (click to open):

Aw, Snap! — Chrome: Aw, Snap! Something went wrong while displaying this webpage. Error code: STATUS_ACCESS_VIOLATION / SIGILL / Out of Memory (Browser)Aw, Snap!captive portal — Browser: This network requires you to sign in — captive portal (hotel, airport, café Wi-Fi) blocking HTTPS sites (Browser)captive portalCSP violation — Refused to load the script because it violates the following Content Security Policy directive (JavaScript)CSP violationDevTools failed to load source map — DevTools: Failed to load source map — Could not load content for https://…/app.js.map: HTTP error: status code 404 (Browser)DevTools failed to lo…ReferenceError — ReferenceError: x is not defined (JavaScript)ReferenceErrorThe canvas has been tainted by cross-origin data — Console: SecurityError: Failed to execute 'toDataURL' / 'getImageData' on 'HTMLCanvasElement': Tainted canvases may not be exported (Browser)The canvas has been t…Unchecked runtime.lastError — Console: Unchecked runtime.lastError: The message port closed before a response was received (extension message) (Browser)Unchecked runtime.las…$ is not …

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.