Failed to create layerview by using @arcgis/core 4.19.3 (React)

819
9
11-11-2021 01:04 AM
kawishabbas
Occasional Contributor

Hello,

I am using @arcgis/core for my react application but I am unable to find the root cause of error. Usually it's working fine but some time I am getting the following error in my console.

Can anyone guide my why some time this error is generated? 

 

errorerror

0 Kudos
9 Replies
ReneRubalcava
Frequent Contributor II

Can't tell with this little info, can you provide a repro to take a closer look.

kawishabbas
Occasional Contributor

Hi @ReneRubalcava ,

following is the git repository.

https://github.com/kawish14/Arcgis-React 

0 Kudos
ReneRubalcava
Frequent Contributor II

Can you simplify it down, this app has a lot going on and I can't get past the login screen when the app starts. I'm going to guess there is an issue around when the MapView is added to the page and when the map and layers are ready to be drawn.

0 Kudos
kawishabbas
Occasional Contributor

@ReneRubalcava 

I have created a new repository and simplified the code. Now the login screen will not appear. Please note that there are two files with the name of Realtime.js and Tracking.js. These two components  receive data from socket server and socket server is hosted on private IP. That is why I have disabled it. Please look at the code of Realtime. As socket clients receive data, I am deleting old record  and adding a new one to Geojson layer. If there is a need for improvement in the code of Realtime, please let me know.

I am very grateful to you.

Repository: https://github.com/kawish14/Arcgis-React-v1 

 

Waiting for your kind response.

0 Kudos
ReneRubalcava
Frequent Contributor II

It's still tough to tell, but it looks like in your code when you use applyEdits, you're not waiting for the async methods to finish before you start running queries. You could wrap some of the async calls in Promise.all(), change them to async/await, or maybe chain the promises to make sure one task is done before starting another.

0 Kudos
kawishabbas
Occasional Contributor

Thank you @ReneRubalcava  for your prompt response.

0 Kudos
kawishabbas
Occasional Contributor

@ReneRubalcava

Have you found, what is the issue? 

0 Kudos
ironmaskito
New Contributor III

I see a similar error after modifying geojson features in my layer and switching from mapView to appView: 

 

react_devtools_backend.js:2540 [esri.views.3d.layers.GeoJSONLayerView3D] #resolve() Failed to resolve layer view (layer title: 'GeoJSON', id: '17d25552b84-layer-4') TypeError: s.equals is not a function
at s (projectExtentUtils.js:5)
at FeatureLikeLayerView3D.js:5

0 Kudos
kawishabbas
Occasional Contributor

Have you resolved it ?

0 Kudos