Hello All,
Can someone tell me how to address the following TypeScript error:
const view = new MapView({ container: mapDiv.current, // ERROR: "Type 'WebMap' is not assignable to type 'MapProperties'." map: webmap });
JSAPI version 4.33
Thanks!
Found it! You have the old AMD types installed too, remove those and you should be good.
https://github.com/CI-CMG/pointstore-dashboard/blob/main/package.json#L21
Probably want to remove "src" from includes in the node tsconfig too
https://github.com/CI-CMG/pointstore-dashboard/blob/main/tsconfig.node.json#L27
Thanks for the suggestion and your offer to help Rene. Re-creating the node_modules and package-lock.json file did not seem to help.
Here's the repo: git@github.com:CI-CMG/pointstore-dashboard.git
Tried this out with a new vite TS app and not seeing this. Could you try deleting your node_modules/package-lock.json/yarn.lock and try again? If you have a github repro, can take a look.
Thanks for your reply. Yes, it looks like this:
const webmap = new WebMap({ portalItem: { id: "43b93cc9be994efbb5a60a2b2d85f151" } }) const view = new MapView({ container: mapDiv.current, // Type 'WebMap' is not assignable to type 'MapProperties'. map: map });
I wonder if I'm missing something in my VSCode configuration then?
Is your webmap constructed using `new Webmap`? I don't get a typescript error in my application using arcgis 4.33 with equivalent code.
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.