# Document is not defined

**URL:** <https://community.transloadit.com/t/document-is-not-defined/14714>\
**Category:** Uppy\
**Created:** [June 27, 2018, 6:25pm UTC](https://community.transloadit.com/t/document-is-not-defined/14714 "2018-06-27T18:25:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![spencerthomas1721](https://avatars.discourse-cdn.com/v4/letter/s/ba8739/32.png) [@spencerthomas1721](https://community.transloadit.com/u/spencerthomas1721)\
**Post date:** [June 27, 2018, 6:25pm UTC](https://community.transloadit.com/t/document-is-not-defined/14714/1 "2018-06-27T18:25:09Z")

</div>

Pretty much what it says on the tin. I just installed Uppy and am trying to integrate it into my website. However, I’m getting the ReferenceError “document is not defined” on line 13 of findDOMElement.js:

> ```
> return document.querySelector(element);
> 
> ```

I’ve reinstalled Uppy twice to no avail. I just don’t see where or how the variable “document” should be declared. I’d appreciate any help you have to offer!

---

<div class="post-metadata">

**Author:** ![artur](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/artur/32/15_2.png) [@artur](https://community.transloadit.com/u/artur)\
**Post date:** [June 27, 2018, 7:22pm UTC](https://community.transloadit.com/t/document-is-not-defined/14714/2 "2018-06-27T19:22:59Z")

</div>

Hi!

`document` is a global variable available in a browser.

Two ideas that come to mind: 1. Make sure your code is running in the browser, not in Node; 2. try placing the `<script>` tag that you use to include Uppy just before the closing `</body>` element in your HTML.

If that doesn’t help, please share the code that you use to run Uppy. Also please check out the live integration example here: [https://codepen.io/uppy/pen/mKrzrM](https://codepen.io/uppy/pen/mKrzrM).

---

<div class="post-metadata">

**Author:** ![spencerthomas1721](https://avatars.discourse-cdn.com/v4/letter/s/ba8739/32.png) [@spencerthomas1721](https://community.transloadit.com/u/spencerthomas1721)\
**Post date:** [June 30, 2018, 7:02pm UTC](https://community.transloadit.com/t/document-is-not-defined/14714/3 "2018-06-30T19:02:58Z")

</div>

… This may seem like a silly question, but how do I run my code in the browser?

---

<div class="post-metadata">

**Author:** ![goto-bus-stop](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/goto-bus-stop/32/18_2.png) [@goto-bus-stop](https://community.transloadit.com/u/goto-bus-stop)\
**Post date:** [July 2, 2018, 9:32am UTC](https://community.transloadit.com/t/document-is-not-defined/14714/4 "2018-07-02T09:32:49Z")

</div>

You can generate a browser capable bundle using [browserify](https://www.npmjs.com/package/browserify) and include it in a script tag.  
I’m curious how you are using it right now—are you running your scripts in Node?
