Esri / arcgis-webpack-plugin

Webpack plugin for the ArcGIS API for JavaScript
Apache License 2.0
134 stars 26 forks source link

4.18: Error: Can't resolve 'moment/locale/en-in.js', 'moment/locale/en-mx.js', 'moment/locale/zh-mo.js' #106

Closed Biboba closed 3 years ago

Biboba commented 3 years ago

Description

Just migrating an application from 4.17 to 4.18 (from AMD to ES Module) and my webpack application no longer compile successfully. The following error is logged:

Capture d’écran 2021-01-23 à 15 43 49

Expected Behavior

Application should compile successfully.

Actual Behavior

Application does not compile successfully.

Possible Fix

I tried to limit the number of locals bundled with the application by specifying "locales: ['en', 'fr']" in webpack config but it does not solve the issue. To be honest, I am not 100% sure where the problem is coming from: arcgis-webpack-plugin ? @arcgis/core ? version 4.18 ? I have trouble to create a simpler application with this bug. So I am asking, hoping you may have some ideas, hints or suggestions to narrow down the issue.

Context

Upgrading an application from arcgis-js-api from 4.17 to 4.18.

Your Environment

Thanks !

andygup commented 3 years ago

@Biboba I see in the error message that there is a dojo/framework/shim/Promise? You might be using an old webpack.config, and shouldn't need this in 4.18.

Have you compared your code and configuration to the patterns in the jsapi-resources/esm-samples repository? https://github.com/Esri/jsapi-resources/tree/master/esm-samples

Biboba commented 3 years ago

Thanks @andygup