FuseJS/ImageTools not working

Version: 0.22.0 (build 6996) Operating system: OSX El Capitan 10.11.5

In the version 0.22.0 (build 6996) FuseJS/ImageTools not working.

Run the command “uno clean” in the directory of the app but still gives that error

This is the log:

LOG: InternalError: Script error: Name: Fuse.Scripting.Error Error message: require(): module not found: FuseJS/ImageTools File name: LoginPage.js Line number: 2 Source line: var ImageTools = require(“FuseJS/ImageTools”); JS stack trace: [Uno code] at Fuse.Scripting.ScriptModule+RequireContext.Require (System.String id) [0x00000] in :0 at Fuse.Scripting.V8.Marshaller+CallbackWrapper.Call (Fuse.Scripting.V8.Simple.UniqueValueVector args) [0x00000] in :0 at Fuse.Scripting.ScriptModule+RequireContext.Require (System.Object[] args) [0x00000] in :0 LOG: Error: JavaScript error in LoginPage.js line 2. require(): module not found: FuseJS/ImageTools in Fuse.Reactive.JavaScript LOG: InternalError: Script error: Name: Fuse.Scripting.Error Error message: require(): module not found: FuseJS/ImageTools File name: LoginPage.js Line number: 2 Source line: var ImageTools = require(‘FuseJS/ImageTools’); JS stack trace: [Uno code] at Fuse.Scripting.ScriptModule+RequireContext.Require (System.String id) [0x00000] in :0 at Fuse.Scripting.V8.Marshaller+CallbackWrapper.Call (Fuse.Scripting.V8.Simple.UniqueValueVector args) [0x00000] in :0 at Fuse.Scripting.ScriptModule+RequireContext.Require (System.Object[] args) [0x00000] in :0 LOG: Error: JavaScript error in LoginPage.js line 2. require(): module not found: FuseJS/ImageTools in Fuse.Reactive.JavaScript LOG: Ingresa al APP LOG: InternalError: Script error: Name: Fuse.Scripting.Error Error message: require(): module not found: FuseJS/ImageTools File name: LoginPage.js Line number: 3 Source line: var ImageTools = require(“FuseJS/ImageTools”); JS stack trace: [Uno code] at Fuse.Scripting.ScriptModule+RequireContext.Require (System.String id) [0x00000] in :0 at Fuse.Scripting.V8.Marshaller+CallbackWrapper.Call (Fuse.Scripting.V8.Simple.UniqueValueVector args) [0x00000] in

:0 LOG: Error: JavaScript error in LoginPage.js line 3. require(): module not found: FuseJS/ImageTools in Fuse.Reactive.JavaScript:0 at Fuse.Scripting.ScriptModule+RequireContext.Require (System.Object[] args) [0x00000] in :0 at Fuse.Scripting.V8.Marshaller+CallbackWrapper.Call (Fuse.Scripting.V8.Simple.UniqueValueVector args) [0x00000] in :0 LOG: Error: JavaScript error in LoginPage.js line 2. require(): module not found: FuseJS/ImageTools in Fuse.Reactive.JavaScript LOG: InternalError: Script error: Name: Fuse.Scripting.Error Error message: require(): module not found: FuseJS/ImageTools File name: LoginPage.js Line number: 2 Source line: var ImageTools = require(“FuseJS/ImageTools”); JS stack trace: [Uno code] at Fuse.Scripting.ScriptModule+RequireContext.Require (System.String id) [0x00000] in :0 at Fuse.Scripting.ScriptModule+RequireContext.Require (System.Object[] args) [0x00000] in :0 at Fuse.Scripting.V8.Marshaller+CallbackWrapper.Call (Fuse.Scripting.V8.Simple.UniqueValueVector args) [0x00000] in :0 LOG: Error: JavaScript error in LoginPage.js line 2. require(): module not found: FuseJS/ImageTools in Fuse.Reactive.JavaScript LOG: InternalError: Script error: Name: Fuse.Scripting.Error Error message: require(): module not found: FuseJS/ImageTools File name: LoginPage.js Line number: 2 Source line: var ImageTools = require(“FuseJS/ImageTools”); JS stack trace: [Uno code] at Fuse.Scripting.ScriptModule+RequireContext.Require (System.String id) [0x00000] in :0 at Fuse.Scripting.ScriptModule+RequireContext.Require (System.Object[] args) [0x00000] in

Did you add a project reference to it?

Yes, this is the .unoproj content:

{ “RootNamespace”:"", “Packages”: [ “Fuse”, “FuseJS”, “Fuse.ImageTools” ], “Includes”: [ “*” ] }

Did you add the Fuse.ImageTools reference to the unoproj while the preview was running?

Help! got the same problem, i did add the Fuse.ImageTools before preview running but displays nothing.

imageTest.unoproj

{
  "RootNamespace":"",
  "Packages": [
  	"Fuse",
  	"FuseJS",
  	"Fuse.ImageTools"
  ],
  "Includes": [
    "*"
  ]
}

MainView.ux

<App>
	<JavaScript>
    var ImageTools = require("FuseJS/ImageTools");
    var Observable = require("FuseJS/Observable");

    var imagePath = Observable();
    var base64Image =    "iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPAQMAAAABGAcJAAAABlBMVEX9//wAAQATpOzaAAAAH0l" +
                        "EQVQI12MAAoMHIFLAAYSEwIiJgYGZASrI38AAAwBamgM5VF7xgwAAAABJRU5ErkJggg==";
    ImageTools.getImageFromBase64(base64Image)
    .then(function(image) {
        imagePath.value = image.path;
    });

    module.exports = { test: new Date().toString(), image: imagePath };
</JavaScript>
<Image File="{image}" />

</App>

What am i doing wrong? this is the exact example from the documentation. BTW i did not know that i have to put Fuse.ImageTools in my unoproj file, there says nothing of that in the documentation.

I am using fuse v0.27 and though it does not crash, it also does not show any image in the desktop live preview but on the device it displays the image quite well.

ImageTools actually uses mobile only implementations for base64 encode/decode with no local desktop fallback yet. This is on my to-do list, sorry about this not being clear!

For future reference, use the catch method on the promise to get the error message.