Skip to content
This repository was archived by the owner on Jun 23, 2025. It is now read-only.
This repository was archived by the owner on Jun 23, 2025. It is now read-only.

Not compatible with Ivy (experimental) #1647

@paullessing

Description

@paullessing

Issue description
When compiling with Ivy, the compilation fails with the following error:

ERROR in src/app/app.module.ts(8,12): error TS-991010: Value at position 1 in the NgModule.importss of AppModule is not a reference: [object Object]

Steps to reproduce and a minimal demo of the problem
I could not create a stackblitz or plunker for this as it is intending to show a compiler failure and I do not know how to demonstrate this.
You can check out https://github.com/paullessing/agm-ivy-demo and attempt to build after running yarn install.

  1. Install new project of Angular 8 using ng new
  2. Add @agm/core and set up the default import
    imports: [
      BrowserModule,
      AgmCoreModule.forRoot({
        apiKey: environment.mapsApiKey,
      })
    ]
    
  3. Enable Ivy in tsconfig.app.json:
    {
      ...
      "angularCompilerOptions": {
         "enableIvy": true
      }
    }
    
  4. Enable AOT in angular.json to work around "lazy routes not found":
    {
      "projects": {
        "my-project": {
          "architect": {
            "build": {
              "options": {
                ...
                "aot": true,
              }
            }
          }
        }
      }
    }
    
  5. Run ng serve

Current behavior
Compile fails with error:

ERROR in src/app/app.module.ts(8,12): error TS-991010: Value at position 1 in the NgModule.importss of AppModule is not a reference: [object Object]

(Position 1 in the imports array is the AgmCoreModule.forRoot())

Expected/desired behavior
No compiler failures

angular2 & angular-google-maps version

"@agm/core": "1.0.0-beta.5",
Angular CLI: 8.0.1
Node: 10.16.0
OS: win32 x64
Angular: 8.0.0
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.800.1
@angular-devkit/build-angular     0.800.1
@angular-devkit/build-optimizer   0.800.1
@angular-devkit/build-webpack     0.800.1
@angular-devkit/core              8.0.1
@angular-devkit/schematics        8.0.1
@angular/cli                      8.0.1
@ngtools/webpack                  8.0.1
@schematics/angular               8.0.1
@schematics/update                0.800.1
rxjs                              6.4.0
typescript                        3.4.5
webpack                           4.30.0

Other information
Compile works when Ivy is disabled.

May be related to angular/angular#28603 which states that if the package.json does not contain a types or typings property, the module will be excluded from compilation.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions