I'm getting an error when adding a graphiclayer to the map with view.map.add(graphiclayer). When I use view.map.addMany([graphiclayer]) the error doesn't show up.
The console error is:
[esri.support.LayersMixin] #add() The item being added is not a Layer or a Promise that resolves to a Layer.
Hi @jauhari_mani, I can't remember the exact cause of the problem (been a long time). It had something to do with package versions if I recall correcltly. If I were you, then migrate directly to the latest version of the API and use the latest packages in your package.json if you are using npm and a build tool like webpack.
Also, consult the jsapi resources for examples how to build: https://github.com/Esri/jsapi-resources/tree/main/esm-samples