ArcGis Js Api Issue with adding KML Layer


I’m using Electron + Arcgis JS API for an application, trying to add a KmlLayer to the map returns error, i’ve tried pointing the file locally however it fails.

var kml = new KMLLayer("");
            kml.on("load", function() {
                domStyle.set("loading", "display", "none");

Returns the following error, somehow it treats all callback as file://, is there anyway to bypass this ?

GET file://…7B%22wkid%22%3A4326%7D&model=simple&folders=&outSR=%7B%22wkid%22%3A4326%7D net::ERR_FILE_NOT_FOUND