# D is not a function

**URL:** <https://meta.discourse.org/t/d-is-not-a-function/51543>\
**Category:** Development\
**Created:** [October 14, 2016, 11:08am UTC](https://meta.discourse.org/t/d-is-not-a-function/51543 "2016-10-14T11:08:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sevenmaxis](https://avatars.discourse-cdn.com/v4/letter/s/bbe5ce/32.png) [@sevenmaxis](https://meta.discourse.org/u/sevenmaxis)\
**Post date:** [October 14, 2016, 11:08am UTC](https://meta.discourse.org/t/d-is-not-a-function/51543/1 "2016-10-14T11:08:24Z")

</div>

I’ve created plugin, under development it works without problem, but in production it produces error:

`Uncaught TypeError: d is not a function`

How to resolve this problem? How to explore this kind of error?

---

<div class="post-metadata">

**Author:** ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)\
**Post date:** [October 14, 2016, 5:13pm UTC](https://meta.discourse.org/t/d-is-not-a-function/51543/2 "2016-10-14T17:13:03Z")

</div>

Your dev tools should provide info about the file and line number where the code errors, or does it not?

My guess is this is a string - stringArray thing and the “d” is the “d” from “discourse.some-function.object”

Can you post that bit of code here or better yet post a link to your GitHub repo?

---

<div class="post-metadata">

**Author:** ![sevenmaxis](https://avatars.discourse-cdn.com/v4/letter/s/bbe5ce/32.png) [@sevenmaxis](https://meta.discourse.org/u/sevenmaxis)\
**Post date:** [October 14, 2016, 6:42pm UTC](https://meta.discourse.org/t/d-is-not-a-function/51543/3 "2016-10-14T18:42:14Z")

</div>

Yes, it has info where the error code appeared, but I guessed it’s not relevant to error itself (because of compressing i think). Here’s the snippet where it happens:

```
_initGoogleDFP: (function () {
  var self = this;
  loadGoogle().then(function () { <==== Uncaught TypeError: d is not a function
    console.log('promise is fullfiled');
...

```

You can check this error on [http://37.48.87.4/](http://37.48.87.4/), open dev tool of course.

---

<div class="post-metadata">

**Author:** ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)\
**Post date:** [October 14, 2016, 7:07pm UTC](https://meta.discourse.org/t/d-is-not-a-function/51543/4 "2016-10-14T19:07:01Z")

</div>

Whew boy, that’s one massive JavaScript file with over 114K lines!

And it looks like my initial guess is likely wrong. Because the script uses single letter variable names ie. `var d =` the d that is not a function could very well be a variable.

If your development is on localhost and your production is on a live host, maybe something isn’t loading in before the script tries to use it?
