question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[ivy] ERROR in Expected array when reading property exports using concat()

See original GitHub issue

🐞 bug report

Affected Package

The issue is caused by package @angular/cli ?

Is this a regression?

NO

Description

When using .concat() to concat two arrays in the exports field of a Module, ivy throws an ERROR in Expected array when reading property exports

The compiled version of the package @swimlane/ngx-charts contains such an concat() that seems to prevent ivy to recognize the export variable as array. Removing concat() and merge the arrays by hand resolves the error. Since concat() returns an Array itself, I see the issue in angular / ivy, not in the ngx-charts package.

The line of the source: https://github.com/swimlane/ngx-charts/blob/4d9f58b1b8ec3127b408964c373613ee961dee71/src/common/chart-common.module.ts#L61

πŸ”¬ Minimal Reproduction

Checkout: https://github.com/maltehol/ivy-ngx-charts and run ng build

πŸ”₯ Exception or Error


ERROR in Expected array when reading property exports

🌍 Your Environment

Angular Version:


     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / β–³ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 8.0.0-beta.11
Node: 11.13.0
OS: win32 x64
Angular: 8.0.0-beta.11
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.800.0-beta.11
@angular-devkit/build-angular     0.800.0-beta.11
@angular-devkit/build-optimizer   0.800.0-beta.11
@angular-devkit/build-webpack     0.800.0-beta.11
@angular-devkit/core              8.0.0-beta.11
@angular-devkit/schematics        8.0.0-beta.11
@angular/@types                   <error>
@angular/events                   <error>
@angular/rxjs                     <error>
@angular/tslib                    <error>
@angular/typescript               <error>
@ngtools/webpack                  8.0.0-beta.11
@schematics/angular               8.0.0-beta.11
@schematics/update                0.800.0-beta.11
rxjs                              6.4.0
typescript                        3.3.4000
webpack                           4.29.6

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
blackholegalaxycommented, May 2, 2019

@JoostK we can confirm using spread syntax in module declaration triggers the error ERROR in Expected array when reading property declarations each time.

exports: [
    ...gmdModules,
    ScrollDispatchModule,
  ],

It’s quite useful to be able to use spread syntax when importing/exporting/declaring large number of modules/components.

1reaction
yantrabcommented, Apr 28, 2019

I have the same with 8.0.0-rc.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

"ERROR in Expected array when reading property imports ...
bug Something isn't working ivy needs-refinement Issue is approved but definition and acceptance criteria need improvement. Projects.
Read more >
Error when implementing charts.js in angular - Stack Overflow
First you define chart as an empty array and then you try to override it with an object. Angular does not like this...
Read more >
akita-state-management/Lobby - Gitter
Ok random question, trying to use the arrayUtils in a Store (non-entity) and ... ERROR TypeError: Cannot assign to read only property 'expanded'...
Read more >
Communicating with backend services using HTTP - Angular
The asynchronous method sends an HTTP request, and returns an Observable that emits the requested data when the response is received. The return...
Read more >
A Practical Guide to Angular Elements - Nitay Neeman's Blog
Learn about the final changes of Angular Elements concerning Angular v6 and how to install, create and use an embeddable Custom ElementΒ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found