Select to view content in your preferred language

Cannot find ArcGIS Maps SDK for Javascript module in 1.12

1071
5
Jump to solution
07-17-2023 06:12 AM
Robert_van_Gilst
Occasional Contributor

I just downloaded version 1.12. But when I now use my widgets in VSCode there is an error when using ArcGIS Maps SDK for Javascript modules.

Robert_van_Gilst_0-1689599394530.png

Thus resulting in no intellisense when using modules from ArcGIS Maps SDK for Javascript.

The code still works, but I would like to have no errors (and intellisense 🙂 )

What to do?

0 Kudos
1 Solution

Accepted Solutions
Robert_van_Gilst
Occasional Contributor

Found a solution.

Added the following line to compilerOptions.paths in tsconfig.json

{
  ...
  "compilerOptions": {
    ...
    "paths": {
      "arcgis-charts": ["jimu-ui/arcgis-charts"],
      "calcite-components": ["jimu-ui/calcite-components/index"],
-->   "esri/*": ["node_modules/@arcgis/core/*"]   <---
    }
  },
  ...
}

I am not sure if this is the correct way to do it, but it doesn't seem to break anything when running, and it removes the underlines missing modules and adds intellisense again.

 

Robert_van_Gilst_0-1689660199100.png

So I am happy 😃

View solution in original post

5 Replies
Robert_van_Gilst
Occasional Contributor

Found a solution.

Added the following line to compilerOptions.paths in tsconfig.json

{
  ...
  "compilerOptions": {
    ...
    "paths": {
      "arcgis-charts": ["jimu-ui/arcgis-charts"],
      "calcite-components": ["jimu-ui/calcite-components/index"],
-->   "esri/*": ["node_modules/@arcgis/core/*"]   <---
    }
  },
  ...
}

I am not sure if this is the correct way to do it, but it doesn't seem to break anything when running, and it removes the underlines missing modules and adds intellisense again.

 

Robert_van_Gilst_0-1689660199100.png

So I am happy 😃

Junshan_Liu
Frequent Contributor

Hi @Robert_van_Gilst It's great you figured it out! This is the patch that does actually the same: https://github.com/Esri/arcgis-experience-builder-sdk-resources/tree/master/patches/1.12/patch1/arcg...

KamilNovák
Regular Contributor

I'm not sure if it can run without that, but do you have this declaration in your widget manifest.json file:

"dependency": "jimu-arcgis"

 

0 Kudos
Robert_van_Gilst
Occasional Contributor

Thanks for the input @KamilNovák but I have the declaration.

0 Kudos
AlejandroMari1
Frequent Contributor

Another solution is to download 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

0 Kudos