Skip to content
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

Cannot build my my apllication using --aot #81

Closed
neolanders opened this issue Mar 29, 2017 · 4 comments
Closed

Cannot build my my apllication using --aot #81

neolanders opened this issue Mar 29, 2017 · 4 comments

Comments

@neolanders
Copy link

neolanders commented Mar 29, 2017

When trying to build my aplication using aot, I'm getting the fallowing issue.
ng build --aot

ERROR in Error encountered resolving symbol values statically. Calling function 'makeDecorator', function calls are not supported. Consider
replacing the function or lambda with a reference to an exported function, resolving symbol Injectable in C:/Users/xalteer/WebstormProjects/
dossier-citoyen-integr-web/node_modules/ng2-formio/node_modules/@angular/core/src/di/metadata.d.ts, resolving symbol OpaqueToken in C:/Users
/xalteer/WebstormProjects/dossier-citoyen-integr-web/node_modules/ng2-formio/node_modules/@angular/core/src/di/opaque_token.d.ts, resolving
symbol OpaqueToken in C:/Users/xalteer/WebstormProjects/dossier-citoyen-integr-web/node_modules/ng2-formio/node_modules/@angular/core/src/di
/opaque_token.d.ts

ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in 'C:\Users\xalteer\WebstormProjects\dossier-citoyen-integr-w
eb\src'
 @ ./src/main.ts 4:0-74
 @ multi ./src/main.ts

@krixerx
Copy link

krixerx commented Apr 2, 2017

We get the same error. This error we have because we are using Angular 4. But when upgrading ng2-formio to RC1, the error is a bit different:

ERROR in Unexpected value 'FormioModule in C:/.../node_modules/ng2-formio/dist/index.d.ts' imported by the module 'AppModule in C:/.../src/app/app.module.ts'. Please add a @NgModule annotation.

Could anyone help please? Is there any quick temporal workaround at least?

@krixerx
Copy link

krixerx commented Apr 3, 2017

I found a quick solution.

  1. in app.modules.ts change FormioModule import to import locally:
    import { FormioModule } from './my-formio';

  2. and then create new file, my-formio.ts:
    import { NgModule } from '@angular/core';
    import { CommonModule } from '@angular/common';
    import { FormioComponent } from 'ng2-formio/dist/formio.component';
    import { FormioAlertsComponent, FormioAlerts } from 'ng2-formio/dist/formio.alerts';
    import { FormioLoader, FormioLoaderComponent } from 'ng2-formio/dist/formio.loader';
    @NgModule({
    imports: [
    CommonModule
    ],
    declarations: [
    FormioComponent,
    FormioLoaderComponent,
    FormioAlertsComponent
    ],
    exports: [
    FormioComponent,
    FormioLoaderComponent,
    FormioAlertsComponent
    ],
    providers: [
    FormioLoader,
    FormioAlerts
    ]
    })
    export class FormioModule {}
    export { FormioAppConfig } from 'ng2-formio/dist/formio.config';
    export { FormioLoader } from 'ng2-formio/dist/formio.loader';

@StephenOTT
Copy link

StephenOTT commented Apr 5, 2017

@neolanders ^

@travist
Copy link
Member

travist commented May 4, 2017

Should be fixed with RC5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants