Skip to content

Bug: Map Fails to Load in Production With Sample App #131

Description

@kevinkerr-cds

Describe the bug
We went through a process to upgrade our Angular app and all of its packages only to discover our map did not load in our production configuration after migrating to Angular 12. We attempted to reproduce using the Esri sample app, and were able to cause the issue with both 4.20 and vnext.

The error is: TypeError: Property description must be an object ...

To Reproduce
Steps to reproduce the behavior:

  1. Download the Angular sample: https://github.com/Esri/jsapi-resources/tree/master/esm-samples/jsapi-angular-cli
  2. Update to vnext: npm install @arcgis/core@next
  3. Run the app in production mode: ng serve --configuration=production
  4. Or run it via http-server:
    ng build --prod
    http-server dist/

Expected behavior
The map should be displayed.

Screenshots
image

Browser

  • Browser: Chrome 91

What's your OS?

  • OS: Windows 10* 64-bit
  • Device: Windows desktop PC

API version (check your console)

  • ArcGIS API for JavaScript 4.21.0-next.20210810 [Revision: d8d62578]]

Additional context
We observed the problem did not manifest when we disable build optimization via:

"optimization": false,

in angular.json

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions