Angular 11 --prod build of `@arcgis/core` application fails to render `Legend` in an `Expand` and `FeatureLayer` symbology
See original GitHub issueI am reporting an issue with
- TypeScript definitions
- [ x ] another resource in this repository
Issue
I’m using @arcgis/core
4.18.1 Beta in an Angular 11 application. It’s a simple application that I’m trying to use as the basis for a blog post about integrating ng components into the DefaultUI
.
When using the development server (ng serve
) or a “non-prod” build (ng build
), the application works as expected. When adding the --prod
flag to the ng build
command, the feature layer renders, but the Legend widget fails and the symbology is not as-defined on the layer.
Replication
Here’s a repository that can be used to replicate the issue: https://github.com/vitale232/ngx-widget-post
The issue is present in both branches. To test the builds, I’m using the lite-server
from npm.
npm install -g lite-server
To see how the application should look and function, run the following:
ng build
lite-server --baseDir dist/ngx-widget
To replicate the issue, run
ng build --prod
lite-server --baseDir dist/ngx-widget
The build runs fine, but the served output is not as expected:
There are some warnings present in the console:
Secondary Issue
I’m not sure if ya’ll intend to support this, but I also tried to build this application in a stackblitz. The blitz is a bit slow to compile, but when it does, the map does not render.
https://stackblitz.com/edit/ngx-widget-esri-core
Aside from this, the ESM build has been a joy to work with. Exciting times for Esri JS devs!
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
Thanks for reporting @vitale232! We are investigating a number of issues related to Angular production builds and the information you have provided is very helpful.
I’ll also take a look at stackblitz, not sure what’s going on there.
We’ll continue to optimize while at the same time we are adding new functionality. It’s a balance of both.
FYI, we’re hoping to have the build error issue resolved at 4.19 (April). Since this is a known problem that we are actively working on. I’ll go ahead and close this issue. Thanks again for reporting!