@arcgis/core: Webpack build running out of memory when importing single ES6 Module

04-08-2021 11:47 AM
New Contributor II


I have spun up a Create React Application and any time I import a single module from arcgis/core e.g:


import Graphic from '@arcgis/core/Graphic'


my build process runs out of memory.


I have also tried building the sample React app here:

and am getting the same issue.


I think it has something to do with Tree Shaking: https://webpack.js.org/guides/tree-shaking/

I'm pretty sure that by importing a single module it imports the entire arcgis/core dependency. I don't know if I'm not importing the modules correctly or if it isn't possible to import just the modules I need.


Is there something that I'm missing?

Thank you

2 Replies
New Contributor III


Same for me, I'm not able to build my project anymore. Though I've sucessfully built https://github.com/Esri/jsapi-resources/tree/master/esm-samples/jsapi-create-react-app, I get around 250 js chunks with this sample... Using esri_loader I had around 5 chunks.

0 Kudos
New Contributor II

Yeah I had to use esri-loader. I wonder if this has been fixed in the latest version of @arcgis/core

0 Kudos