Skip to content

AoT compiler errors #94

@borodiliz

Description

@borodiliz

Ionic-audio version:
[ X] 2.3.0

I'm submitting a ...
[ X] bug report (probably but not sure if there is any workarround to solve this)

Current behavior:

When trying to compile using AoT I get the following error:

[13:26:16]  build prod failed: Error encountered resolving symbol values statically. Function calls are not supported. 
            Consider replacing the function or lambda with a reference to an exported function, resolving symbol 
            AppModule in /datos/borja/proyectos/myapp-app-v2/src/app/app.module.ts, resolving symbol AppModule in 
            /datos/borja/proyectos/myapp-app-v2/src/app/app.module.ts 
[13:26:16]  ionic-app-script task: "build" 
[13:26:16]  Error: Error encountered resolving symbol values statically. Function calls are not supported. Consider 
            replacing the function or lambda with a reference to an exported function, resolving symbol AppModule in 
            /datos/borja/proyectos/myapp-app-v2/src/app/app.module.ts, resolving symbol AppModule in 
            /datos/borja/proyectos/myapp-app-v2/src/app/app.module.ts 
Error: Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol AppModule in /datos/borja/proyectos/myapp-app-v2/src/app/app.module.ts, resolving symbol AppModule in /datos/borja/proyectos/myapp-app-v2/src/app/app.module.ts
    at simplifyInContext (/datos/borja/proyectos/myapp-app-v2/node_modules/@angular/compiler-cli/src/static_reflector.js:475:23)
    at StaticReflector.simplify (/datos/borja/proyectos/myapp-app-v2/node_modules/@angular/compiler-cli/src/static_reflector.js:478:22)
    at StaticReflector.annotations (/datos/borja/proyectos/myapp-app-v2/node_modules/@angular/compiler-cli/src/static_reflector.js:60:36)
    at NgModuleResolver.resolve (/datos/borja/proyectos/myapp-app-v2/node_modules/@angular/compiler/bundles/compiler.umd.js:14261:46)
    at CompileMetadataResolver._loadNgModuleMetadata (/datos/borja/proyectos/myapp-app-v2/node_modules/@angular/compiler/bundles/compiler.umd.js:14646:45)
    at CompileMetadataResolver.getUnloadedNgModuleMetadata (/datos/borja/proyectos/myapp-app-v2/node_modules/@angular/compiler/bundles/compiler.umd.js:14636:23)
    at addNgModule (/datos/borja/proyectos/myapp-app-v2/node_modules/@angular/compiler/bundles/compiler.umd.js:12944:43)
    at /datos/borja/proyectos/myapp-app-v2/node_modules/@angular/compiler/bundles/compiler.umd.js:12957:16
    at Array.forEach (native)
    at _createNgModules (/datos/borja/proyectos/myapp-app-v2/node_modules/@angular/compiler/bundles/compiler.umd.js:12956:28)

Expected behavior:

An application compiled with AoT

Steps to reproduce:

Just execute: ionic build android --prod --release

This is not happening when using ionic build android --dev

Related code:

I suspect the problem is on the dynamic initialization on ionic-audio.module.ts but I have no idea about how to fix this.

  static forRoot(audioProvider?: AudioProvider): ModuleWithProviders {
    let audioProviderInit = audioProvider ? 
      { provide: AudioProvider, useValue: audioProvider } : 
      { provide: AudioProvider, useFactory: audioProviderfactory };
    return {
      ngModule: IonicAudioModule,
      providers: [
        audioProviderInit
      ]
    };
  }

Other information:

Ionic info:

Cordova CLI: 6.5.0
Ionic Framework Version: 2.0.1
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.1.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 4.4
Node Version: v6.9.1
Xcode version: Not installed

Thanks man for this amazing plugin!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions