# Uncaught TypeError: $ is not a function

**URL:** <https://discourse.roots.io/t/uncaught-typeerror-is-not-a-function/5749>\
**Category:** sage\
**Tags:** gulp\
**Created:** [January 23, 2016, 7:27pm UTC](https://discourse.roots.io/t/uncaught-typeerror-is-not-a-function/5749 "2016-01-23T19:27:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kerruba](https://discourse.roots.io/user_avatar/discourse.roots.io/kerruba/32/2865_2.png) [@Kerruba](https://discourse.roots.io/u/Kerruba)\
**Post date:** [January 23, 2016, 7:27pm UTC](https://discourse.roots.io/t/uncaught-typeerror-is-not-a-function/5749/1 "2016-01-23T19:27:59Z")

</div>

Hello there.

I’m quite new to Root and it seems I’m having trouble with jQuery, but I don’t know why.  
Here the situation: I was developing a theme and everything seemed to work fine. Suddenly (I assure you, if I did something I can’t understand what I’ve done) the console is giving me this error, and I don’t know why.

Maybe a second pair of eye can help me figure out what is going on:  
**manifest.json**

```json
{
  "dependencies": {
    "main.js": {
      "files": [
        "scripts/main.js"
      ],
      "main": true
    },
    "main.css": {
      "files": [
        "styles/main.scss"
      ],
      "main": true
    },
    "editor-style.css": {
      "files": [
        "styles/editor-style.scss"
      ]
    },
    "carousel.js": {
      "files": [
        "scripts/carousel.js"
      ],
      "bower": [
        "fullpage.js",
        "slick-carousel"
      ]
    },
    "carousel.css": {
      "files": [
        "styles/carousel.scss"
      ],
      "bower": [
        "fullpage.js",
        "slick-carousel"
      ]
    },
    "jquery.js": {
      "bower": ["jquery"]
    },
    "modernizr.js": {
      "bower": ["modernizr"]
    }
  },
  "config": {
    "devUrl": "http://local.wordpress.dev/"
  }
}

```

**carousel.js**

```nohighlight
(function($){
	"use strict";

	$(document).ready(function(){

	});
})(jQuery);

```

**asset function**

```php
function assets() {
  wp_enqueue_style('mdl_icons', 'https://fonts.googleapis.com/icon?family=Material+Icons', false, null);
  wp_enqueue_style('sage_css', asset_path('styles/main.css'), false, null);

  if (is_single() && comments_open() && get_option('thread_comments')) {
    wp_enqueue_script('comment-reply');
  }

  wp_enqueue_script('modernizr', asset_path('scripts/modernizr.js'), [], null, true);
  wp_enqueue_script('sage_js', asset_path('scripts/main.js'), ['jquery'], null, true);
  if (is_front_page()) {
    wp_enqueue_script('frontpage_js', asset_path('scripts/carousel.js'), ['jquery'], null, true);
    // wp_enqueue_style('frontpage_css', asset_path('styles/carousel.css'));
  }
}

```

The ` Uncaught TypeError: $ is not a function` is on `main.js : 2`…but I did nothing on `main.js`

Thank you for any help you can give me

---

<div class="post-metadata">

**Author:** ![shaimoom](https://discourse.roots.io/user_avatar/discourse.roots.io/shaimoom/32/6322_2.png) [@shaimoom](https://discourse.roots.io/u/shaimoom)\
**Post date:** [January 25, 2016, 5:01pm UTC](https://discourse.roots.io/t/uncaught-typeerror-is-not-a-function/5749/2 "2016-01-25T17:01:06Z")

</div>

Try this:

```
(function($){
	"use strict";

	jQuery(document).ready(function(){

	});
})(jQuery);

```

replacing the `$` with `jQuery` resolved this issue for me in the past.
