Skip to content

error NG1010: Value at position 0 in the NgModule.declarations of Module is not a reference #38947

@kumaresan-subramani

Description

@kumaresan-subramani

🐞 Bug report

If I do a postinstall ngcc I get the following errors in our library

Error: Failed to compile entry-point @syncfusion/ej2-angular-calendars (main as umd) due to compilation errors:
node_modules/@syncfusion/ej2-angular-calendars/dist/ej2-angular-calendars.umd.js:174:31 - error NG1010: Value at position 0 in the NgModule.declarations of CalendarModule is not a reference
  Value could not be determined statically.

174                 declarations: [
                                  ~
175                     exports.CalendarComponent
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
176                 ],
    ~~~~~~~~~~~~~~~~~

  node_modules/@syncfusion/ej2-angular-calendars/dist/ej2-angular-calendars.umd.js:175:21
    175                     exports.CalendarComponent
                            ~~~~~~~~~~~~~~~~~~~~~~~~~
    Unable to evaluate statically.
node_modules/@syncfusion/ej2-angular-calendars/dist/ej2-angular-calendars.umd.js:166:5 - error NG6002: Appears in the NgModule.imports of CalendarAllModule, but could not be resolved to an NgModule class.

Is it missing an @NgModule annotation?

166 var CalendarModule = /** @class */ (function () {
        ~~~~~~~~~~~~~~
node_modules/@syncfusion/ej2-angular-calendars/dist/ej2-angular-calendars.umd.js:166:5 - error NG6003: Appears in the NgModule.exports of CalendarAllModule, but could not be resolved to an NgModule, Component, Directive, or Pipe class.

Is it missing an Angular annotation?

Is this a regression?

Working fine with out "postinstall": "ngcc"

🔬 Minimal Reproduction

  1. download my sample - https://github.com/kumaresan-subramani/Syncfusion-Calendar-Error-1

  2. then give npm i or yarn i

My reported issue will occurs.

🔥 Exception or Error

image

🌍 Your Environment


    "@angular/animations": "~10.1.0",
    "@angular/common": "~10.1.0",
    "@angular/compiler": "~10.1.0",
    "@angular/core": "~10.1.0",
    "@angular/forms": "~10.1.0",
    "@angular/platform-browser": "~10.1.0",
    "@angular/platform-browser-dynamic": "~10.1.0",
    "@angular/router": "~10.1.0",
    "@angular-devkit/build-angular": "~0.1001.0",
    "@angular/cli": "~10.1.0",
    "@angular/compiler-cli": "~10.1.0",

Anything else relevant?
I have done some researching and found that below issue and tried everything which are reported in those issues but no luck for me.

#35255 (comment) - downgraded ts version same error
#36673 (comment) - tried changed my module declaration

This is our component config -

https://github.com/syncfusion/ej2-angular-ui-components/tree/master/components/calendars/src/calendar

Note: i am using ng-packagr to generate my angular library

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions