# Critical Bug/Error: FuseJS Models require() and .unoproj file

**URL:** <https://forums.fusetools.com/t/critical-bug-error-fusejs-models-require-and-unoproj-file/4161>\
**Category:** Bug Reports\
**Created:** [March 29, 2018, 5:01pm UTC](https://forums.fusetools.com/t/critical-bug-error-fusejs-models-require-and-unoproj-file/4161 "2018-03-29T17:01:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Francesco](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/francesco/32/781_2.png) [@Francesco](https://forums.fusetools.com/u/Francesco)\
**Post date:** [March 29, 2018, 5:01pm UTC](https://forums.fusetools.com/t/critical-bug-error-fusejs-models-require-and-unoproj-file/4161/1 "2018-03-29T17:01:57Z")

</div>

Fuse version = 1.8.1 (build 15610)  
Operating system version = Windows 7 x64 SP1

**Project.unoproj**

```auto
{
  "RootNamespace":"",
  "Packages": [
     "Fuse",
     "FuseJS"
  ],
  "Includes": [
    "*",
    "App/*.js:Bundle"
  ]
}

```

**MainView.ux**

```auto
<App Background="#24211e">
	<JavaScript File="MainView.js"/>
	<Router ux:Name="router"/>
</App>

```

**MainView.js**

```auto
var Controllers = require("App/Controllers");

console.log(Controllers.getToken());

module.exports = {
};

```

**App/Controller.js**

```auto
var Auth = require("App/Auth");

module.exports = {
	getToken: function(){
		return Auth.login('Francesco'); 
	} 
};

```

**App/Auth.js**

```auto
var Config = require("App/Config");
 
var Observable = require("FuseJS/Observable"); 
var Storage = require("FuseJS/Storage");
var FileSystem = require("FuseJS/FileSystem");
var Environment = require("FuseJS/Environment");

function login(name){
	console.log(name+Config.Surname);
}
module.exports = {
	login : login
};

```

**App/Config.js**

```auto
var Surname="Calculli";

module.exports = {
	Surname: Surname
};

```

Hi! We have reduced a lot the code to make it easier. So, the problem is that when I require a FuseJS model console log gives me the same error, like this:

```auto
[Viewport]: Error: : Uncaught require(): module not found: FuseJS/Storage in Fuse.Scripting.DiagnosticSubject<App/Auth.js:4>

```

but there is nothing wrong with the code… help me please!!

---

<div class="post-metadata">

**Author:** ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)\
**Post date:** [March 30, 2018, 7:18am UTC](https://forums.fusetools.com/t/critical-bug-error-fusejs-models-require-and-unoproj-file/4161/2 "2018-03-30T07:18:14Z")

</div>

Hi Francesco,

tested and indeed, there is nothing wrong with your code. `Storage` works just fine for me here.

I should point out that the error you are getting has absolutely nothing to do with Fuse Models feature, since you’re essentially not using it at all.

The only thing that I find suspicious is the .js include in your .unoproj file, which I suggest you change to this: `"**.js:Bundle"`.

Following the change, run `uno clean` in your project root folder, rebuild the project and see if that helps. If it doesn’t, please post a complete reproduction that reliably triggers the issue (a .zip of your project could work).

---

<div class="post-metadata">

**Author:** ![Francesco](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/francesco/32/781_2.png) [@Francesco](https://forums.fusetools.com/u/Francesco)\
**Post date:** [March 30, 2018, 8:58am UTC](https://forums.fusetools.com/t/critical-bug-error-fusejs-models-require-and-unoproj-file/4161/3 "2018-03-30T08:58:52Z")

</div>

Hi Uldis, I tested “\*\*.js:Bundle” in my .unoproj file but it gives me the same problem. Here’s the .zip of the project. Hope you can help me

[https://drive.google.com/open?id=1qz9KoVs6rh3-RWue32zqa1J2SyXSeyro](https://drive.google.com/open?id=1qz9KoVs6rh3-RWue32zqa1J2SyXSeyro)

---

<div class="post-metadata">

**Author:** ![Francesco](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/francesco/32/781_2.png) [@Francesco](https://forums.fusetools.com/u/Francesco)\
**Post date:** [March 30, 2018, 1:42pm UTC](https://forums.fusetools.com/t/critical-bug-error-fusejs-models-require-and-unoproj-file/4161/4 "2018-03-30T13:42:50Z")

</div>

Uldis sorry, the problem is solved! I re-created the project with the same files and now it works fine. Thanks!
