Select to view content in your preferred language

Question about import syntax for Map web components

677
10
12-08-2025 05:02 PM
JonathanTiu
Occasional Contributor

Hi,

On the official documentation it says to import web components like this:

import '@arcgis/map-components/components/arcgis-scale-bar'

 

but in practice i have to import it with the dist folder or else it won't find it.

on disk, i do see the folder path under node_modules is arcgis/map-components/dist/components/arcgis-scale-bar but it feels like there is some missing mapping maybe.

import '@arcgis/map-components/dist/components/arcgis-scale-bar'.
 
i did an npm install and saved it to my package.json.  I'm not sure why i have to specify the dist folder
 
Jonathan
0 Kudos
10 Replies
Sage_Wall
Esri Regular Contributor

Thanks for the additional information @JasonDoingMaps .  I'll add some information about the moduleResoultion setting to our documentation to hopefully avoid this confusion for other users in the future.