Web AppBuilder Dev Edition: Constructing FeatureLayer object throwing TypeError: Cannot read properties of null (reading 'path')

690
0
02-12-2023 10:08 AM
Labels (1)
EmmaHatcher
Occasional Contributor

Hello,

I am working with Web AppBuilder Developer Edition version 2.26. I wrote a simple function that is supposed to build a FeatureLayer object using the supplied service URL, then supply an array of edits. When debugging with a breakpoint, the svcUrl variable in the code below is populated with the correct service URL, but I am getting the following error: 

TypeError: Cannot read properties of null (reading 'path')

I included 'esri/layers/FeatureLayer' in the define list and declared as a function called FeatureLayer.

 

 

_applyFtEdits: function (svcUrl, edits) {
    var ftLyr = new FeatureLayer({
        url: svcUrl
    });

    ftLyr.applyEdits(edits);
        console.log("APPLY FEATURE EDITS CALLED.");
    },

 

 

 

I am working with a secure feature service published in an organization Portal, but the app is being tested in ArcGIS Online. Is this error potentially the result of not supplying a token to authenticate? The app prompts a sign-in to the Portal hosting the service on load. I was hoping that would cover authentication...

0 Kudos
0 Replies