Select to view content in your preferred language

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

2583
9
11-11-2021 01:04 AM
kawishabbas
Regular 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

9 Replies
ReneRubalcava
Honored Contributor

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

kawishabbas
Regular Contributor

Hi @ReneRubalcava ,

following is the git repository.

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

0 Kudos
ReneRubalcava
Honored Contributor

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
Regular 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
Honored Contributor

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
Regular Contributor

Thank you @ReneRubalcava  for your prompt response.

0 Kudos
kawishabbas
Regular Contributor

@ReneRubalcava

Have you found, what is the issue? 

0 Kudos
ironmaskito
Occasional Contributor

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
Regular Contributor

Have you resolved it ?

0 Kudos