Select to view content in your preferred language

Developer Edition 1.12 seems to lack TypeScript definitions

1049
6
Jump to solution
07-26-2023 07:16 AM
JeremyKolassa
Emerging Contributor

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 GraphicPoint, and other JSAPI components into Experience Builder to cut down on the errors?

1 Solution

Accepted Solutions
Junshan_Liu
Frequent Contributor

Are there still typing errors after patch? The type definition file is interfaces.d.ts in @ArcGIS/core.

View solution in original post

6 Replies
AlejandroMari1
Frequent Contributor

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

Junshan_Liu
Frequent Contributor

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

0 Kudos
Junshan_Liu
Frequent Contributor

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...?

0 Kudos
JeremyKolassa
Emerging Contributor

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/

0 Kudos
Junshan_Liu
Frequent Contributor

Are there still typing errors after patch? The type definition file is interfaces.d.ts in @ArcGIS/core.

JeremyKolassa
Emerging Contributor

Hi Junshan,

Just did this in a fresh ExB project and it worked! Thanks!

0 Kudos