# fetch is not defined

**URL:** https://forums.fusetools.com/t/fetch-is-not-defined/6474
**Category:** Bug Reports
**Created:** [November 3, 2016, 7:39pm UTC](https://forums.fusetools.com/t/fetch-is-not-defined/6474 "2016-11-03T19:39:35Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![iUseFuse](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/iusefuse/32/747_2.png) [@iUseFuse](https://forums.fusetools.com/u/iUseFuse)
#### Post date: [November 3, 2016, 7:39pm UTC](https://forums.fusetools.com/t/fetch-is-not-defined/6474/1 "2016-11-03T19:39:35Z")

</div>

Since the last update from version 0.27.1.7935 to version 0.28.1.8199 fuse keeps telling me, that

`JS stack trace: ReferenceError: fetch is not defined`

but the code hasn’t changed in any way and it worked fine before.

did i miss something? is there now a replacement for fetch or so?

---

<div class="post-metadata">

### Author: ![Anders\_Bondehagen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/anders_bondehagen/32/98_2.png) [@Anders\_Bondehagen](https://forums.fusetools.com/u/Anders_Bondehagen)
#### Post date: [November 4, 2016, 10:33am UTC](https://forums.fusetools.com/t/fetch-is-not-defined/6474/2 "2016-11-04T10:33:43Z")

</div>

I can’t see any code changes that would lead to this. I am pretty sure fetch is working for other users. How do you use it?

---

<div class="post-metadata">

### Author: ![iUseFuse](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/iusefuse/32/747_2.png) [@iUseFuse](https://forums.fusetools.com/u/iUseFuse)
#### Post date: [November 5, 2016, 4:29pm UTC](https://forums.fusetools.com/t/fetch-is-not-defined/6474/3 "2016-11-05T16:29:17Z")

</div>

Yes, you’re right. I still haven’t found out what’s wrong, but it’s not a bug indeed as it seems.

I created a whole new project just contaning the MainView.ux

```auto
<App>
	<JavaScript File="MainView.js" />
</App>

```

And the MainView.js

```auto
function test() {
    fetch('http://www.google.com/', {
        method: 'POST',
        async: false
    }).then(function(response) {
        console.log(JSON.stringify(response));
    }).catch(function(err) {
        console.log(JSON.stringify(err));
    });
}

test();

```

And that one works pretty fine.

Sorry for bringing this up, before testing it properly.

---

<div class="post-metadata">

### Author: ![iUseFuse](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/iusefuse/32/747_2.png) [@iUseFuse](https://forums.fusetools.com/u/iUseFuse)
#### Post date: [November 5, 2016, 6:20pm UTC](https://forums.fusetools.com/t/fetch-is-not-defined/6474/4 "2016-11-05T18:20:15Z")

</div>

And i finally found the reason too.

I do have two JavaScript Modules in my code, which i do include in the .unoproj file with

```auto
"Includes": [
    "FirstModule.js:Bundle",
    "SecondModule.js:Bundle",
]

```

I do use them in the MainView.js with

```auto
var firstModule = require('/FirstModule');
var secondModule = require('/SecondModule');

```

that’s working fine, BUT i also had this in the MainView.ux:

```auto
<JavaScript File="FirstModule.js" ux:Global="LanguagesModule" />
<JavaScript File="SecondModule.js" ux:Global="LanguagesModule" />
<JavaScript File="MainView.js" />

```

For some reasons i don’t know, that worked before and now lead to the `JS stack trace: ReferenceError: fetch is not defined` error.  
So all i changed the MainView.ux into this

```auto
<JavaScript File="MainView.js" />

```

and now the error is gone.

Hope this might help someone else too.
