Native JavaScript Modules


Ive been playing around with creating my own modules but I cant seem to get them to load properly. Ive tried the code from the docs (, but still seem to get the following error:

Error: : Error message: Uncaught require(): module not found: MyLogModule

Following is the setup I am using:

using Fuse;
using Fuse.Scripting;
using Uno.UX;

public class MyLogModule : NativeModule
    static readonly MyLogModule _instance;

    public MyLogModule()
        // Make sure we're only initializing the module once
        if (_instance != null) return;

        _instance = this;
        Resource.SetGlobalKey(_instance, "MyLogModule");
        AddMember(new NativeFunction("Log", (NativeCallback)Log));

    static object Log(Context c, object[] args)
        foreach (var arg in args)
            debug_log arg;

        return null;


            var LogModule = require("MyLogModule");

            LogModule.Log("Hello from JavaScript!");


  "Packages": [
  "Includes": [

What am I doing wrong?

Hi kvhauw,

that second line in Includes is not necessary, since the * includes any .uno files at the project root.

Did you run uno clean and rebuilt the preview?