Search code examples
webpackarcgis-js-apireact-typescript

ArcGIS webpack plugin for rendering map, Module not found: Error: Can't resolve 'esri/Map'


Here is the repository https://github.com/phanivaranasi/mancycle

This application is built using react + typescript + webpack .. trying to render map, using ArcGIS with webpack but getting error Module not found: Error: Can't resolve 'esri/Map'
Reference https://github.com/Esri/jsapi-resources/tree/master/4.x/webpack/demo as mentioned in youtube tutorial https://www.youtube.com/watch?v=P0oZWJkYKXg

Kindly help me in fixing the issue.

error screenshot


Solution

  • You are missing this in your resolve portion of your webpack config:

    alias: {
        "esri": path.resolve(__dirname, 'node_modules/arcgis-js-api/')
    }