guillotinaweb / ngx-schema-form

HTML form generation based on JSON Schema
MIT License
485 stars 173 forks source link

Not compatible with ng-alain #156

Open vellengs opened 7 years ago

vellengs commented 7 years ago

I'm using ng-alain, but only import your module for root, got those errors.

ERROR in Error: Error encountered resolving symbol values statically. Calling function 'SchemaFormModule', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol AppModule in /Users/xxxxx/projects/ng-alain/src/app/app.module.ts, resolving symbol AppModule in /Users/xxxxx/projects/ng-alain/src/app/app.module.ts
    at syntaxError (/Users/xxxxx/projects/ng-alain/node_modules/@angular/compiler/bundles/compiler.umd.js:1729:34)
    at simplifyInContext (/Users/xxxxx/projects/ng-alain/node_modules/@angular/compiler/bundles/compiler.umd.js:24979:23)
    at StaticReflector.simplify (/Users/xxxxx/projects/ng-alain/node_modules/@angular/compiler/bundles/compiler.umd.js:24991:13)
    at StaticReflector.annotations (/Users/xxxxx/projects/ng-alain/node_modules/@angular/compiler/bundles/compiler.umd.js:24418:41)
    at _getNgModuleMetadata (/Users/xxxxx/projects/ng-alain/node_modules/@angular/compiler-cli/src/ngtools_impl.js:138:31)
    at _extractLazyRoutesFromStaticModule (/Users/xxxxx/projects/ng-alain/node_modules/@angular/compiler-cli/src/ngtools_impl.js:109:26)
    at Object.listLazyRoutesOfModule (/Users/xxxxx/projects/ng-alain/node_modules/@angular/compiler-cli/src/ngtools_impl.js:53:22)
    at Function.NgTools_InternalApi_NG_2.listLazyRoutes (/Users/xxxxx/projects/ng-alain/node_modules/@angular/compiler-cli/src/ngtools_api.js:91:39)
    at AotPlugin._getLazyRoutesFromNgtools (/Users/xxxxx/projects/ng-alain/node_modules/@ngtools/webpack/src/plugin.js:212:44)
    at _donePromise.Promise.resolve.then.then.then.then.then (/Users/xxxxx/projects/ng-alain/node_modules/@ngtools/webpack/src/plugin.js:448:24)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

webpack: Failed to compile.

you can see the code changes

https://github.com/vellengs/ng-alain/tree/master
ebrehault commented 7 years ago

The forRoot() method is quite recent, can you check if you are not using an old version in your node_modules forlder?

vellengs commented 7 years ago

Yes,after remove forRoot , It works.