Hello all,
In previous editions of Experience Builder, inside /client/types there was a definitions file for the JSAPI, arcgis-js-api.d.ts. However, I notice that in 1.12, the file is missing, and so when I try to import Graphic from esri/Graphic, my IDE gives me an error.
Was this something that changed between the release of 1.10 and 1.12? 1.11 has the file. I looked over the changelog and didn't see anything about it, but it might just be my eyes glazed over the actual note. If this is intentional, then how should I be importing Graphic, Point, and other JSAPI components into Experience Builder to cut down on the errors?
Solved! Go to Solution.
Are there still typing errors after patch? The type definition file is interfaces.d.ts in @ArcGIS/core.
Same here. I could fix it by downloading the 4.27 TypeScript definition file from Esri's GitHub page: https://github.com/Esri/jsapi-resources/blob/main/4.x/typescript/arcgis-js-api.d.ts
And adding it to the /client/types folder
Hi @JeremyKolassa In 1.12, the JSAPI is installed as a dependency. After you run npm ci, you should be able to see it at node_modules/@arcgis/core
Hi @JeremyKolassa We lost one config in tsconfig.json, could you please try this patch: https://github.com/Esri/arcgis-experience-builder-sdk-resources/tree/master/patches/1.12/patch1/arcg...?
Hi, very sorry for the delay -- I got around this for awhile by using __esri namespace, though suddenly after switching machines that has stopped working and I can't see why. However, debugging that has brought me here.
Even after applying the tsconfig.json patch, there is still no arcgis-js-api-d.ts file inside node_modules/@arcgis/core/.
Are there still typing errors after patch? The type definition file is interfaces.d.ts in @ArcGIS/core.
Hi Junshan,
Just did this in a fresh ExB project and it worked! Thanks!