Skip to content

IVY: Value at position 13 in the NgModule.imports of AppModule is not a reference #32025

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spock123 opened this issue Aug 6, 2019 · 6 comments
Milestone

Comments

@spock123
Copy link

spock123 commented Aug 6, 2019

🐞 bug report

Angular 9.0.0-next.0

Is this a regression?

Yes, works fine in Angular 8.2.0 without IVY enabled

Description

Enabling IVY, upgrading to 9.0.0-next.0 gives errors.

ERROR in app/modules/paymentcard-bizz/paymentcard-bizz.module.ts:41:17 - error TS-991010: Value at position 0 in the NgModule.declarations of PaymentcardBizzModule is not a reference: [object Object]

41   declarations: [...components,...views],
                   ~~~~~~~~~~~~~~~~~~~~~~~~
app/app.module.ts:68:12 - error TS-991010: Value at position 13 in the NgModule.imports of AppModule is not a reference: [object Object]

 68   imports: [
               ~
 69     BrowserModule,
    ~~~~~~~~~~~~~~~~~~
... 
 98     })
    ~~~~~~
 99   ],

🌍 Your Environment

Angular Version:



Angular CLI: 8.3.0-next.0
Node: 12.2.0
OS: darwin x64
Angular: 9.0.0-next.0
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router, service-worker

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.803.0-next.0
@angular-devkit/build-angular     0.803.0-next.0
@angular-devkit/build-optimizer   0.803.0-next.0
@angular-devkit/build-webpack     0.803.0-next.0
@angular-devkit/core              8.3.0-next.0
@angular-devkit/schematics        8.3.0-next.0
@angular/cdk                      8.1.2
@angular/cli                      8.3.0-next.0
@angular/material                 8.1.2
@angular/pwa                      0.803.0-next.0
@ngtools/webpack                  8.3.0-next.0
@schematics/angular               8.3.0-next.0
@schematics/update                0.803.0-next.0
rxjs                              6.5.2
typescript                        3.5.3
webpack                           4.38.0

Anything else relevant?

Tsconfig.json:


{
  "compileOnSave": false,
  "angularCompilerOptions": {
    "enableIvy": true
  },
  "compilerOptions": {
    "baseUrl": "./src",
    "importHelpers": true,
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    //"module": "es2015",
    "module": "esnext",
    "moduleResolution": "node",
    "noImplicitAny": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "skipLibCheck": true,
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2018",
      "dom"
    ],
    "paths": {
      "@store/*": ["app/store/*", "app/store"],
      "@store": ["app/store/*", "app/store"],
      "@modules/*": ["app/modules/*", "app/modules"],
      "@modules": ["app/modules/*", "app/modules"],
      "@main/*": ["app/main/*", "app/main"],
      "@main": ["app/main/*", "app/main"],
      "@environment": ["environments/environment"],
      "@lib/*": ["app/lib/*", "app/lib"],
      "@lib": ["app/lib/*", "app/lib"],
      "@iticket-business/*": [ "app/modules/iticket-business/*", "app/modules/iticket-business"]
    }
  }
}

Seamingly nothing wrong with code, imports are legit.
Works fine without IVY
Can it be because I'm using paths in tsconfig?

@spock123
Copy link
Author

spock123 commented Aug 6, 2019

Could it be related to this?
angular/angular-cli#14594

I use tsconfig paths heavily to make it easier to import stuff

@ngbot ngbot bot added this to the needsTriage milestone Aug 6, 2019
@spock123
Copy link
Author

Tried same code with Angular 9.0.0-next.2

Getting following error during "ng serve":

ERROR in Attempted to get members of a non-class: "class PerMessageDeflate

@spock123
Copy link
Author

We can close this case.
I had a file with .js extension instead of .ts.

Pretty stupid, but there was no error in non-Ivy, but Ivy complained (rightfully so),

I'll close this, but for anyone else getting this error, check your file extensions carefully.

@TheYellowThorn
Copy link

We are still getting this issue as well when importing an internal library while running Angular 9:

Value at position 3 in the NgModule.imports of AppModule is not a reference: [object Object]

Angular CLI: 9.0.0-next.3
Node: 10.11.0
OS: darwin x64
Angular: 9.0.0-next.5
... core

Package Version

@angular-devkit/architect 0.802.1
@angular-devkit/build-angular 0.802.1
@angular-devkit/build-optimizer 0.802.1
@angular-devkit/build-webpack 0.802.1
@angular-devkit/core 8.2.1
@angular-devkit/schematics 9.0.0-next.3
@angular/animation 4.0.0-beta.8
@angular/animations 8.2.5
@angular/cdk 8.1.4
@angular/cli 9.0.0-next.3
@angular/common 8.2.2
@angular/compiler 8.2.2
@angular/compiler-cli 8.2.2
@angular/forms 8.2.2
@angular/http 7.2.15
@angular/language-service 8.2.2
@angular/material 8.1.4
@angular/platform-browser 8.2.2
@angular/platform-browser-dynamic 8.2.2
@angular/router 8.2.2
@ngtools/json-schema 1.2.0
@ngtools/webpack 8.2.1
@schematics/angular 9.0.0-next.3
@schematics/package-update 0.3.2
@schematics/update 0.900.0-next.3
rxjs 6.5.2
typescript 3.5.3
webpack 4.38.0

@alxhub
Copy link
Member

alxhub commented Sep 9, 2019

@TheYellowThorn do you have a small reproduction repo you can share with us?

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants