-
Notifications
You must be signed in to change notification settings - Fork 177
AOT compilation error: Function calls are not supported in decorators but 'JsonSchemaFormModule' was called. #189
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
Comments
@chivalme would also add that it's a regression in the issue type. It is working in the previous version It's what's currently preventing us from upgrading and I imagine others new to the library from adopting it. I am however not quite certain that this issue applies to all build configurations that use AoT as I've seen similar issues before where this was the case. It is however an issue with |
Hi @Koslun , as I got this: https://photos.app.goo.gl/gemkOkHSmH98YWew2 may be I tuned something in a wrong way, of course, as I downgraded using this commit: dschnelldavis/ng-jsf-material-design-seed@cb3c532 - and I might miss something.. |
I'm running into this issue was well. I was previously using 0.6.0-alpha.7 but was compiling with ng4.x. Upgraded to ng5.1, and upgraded this library. Runs fine when using ng serve, but blows up when using the aot compiler when building a prod build.
|
@fastovezz We are using Figured that bootstrap would screw other things and that downgrading Material itself would screw up a lot of other stuff for us as well. So settled on using no framework, which works pretty well. Only caveat so far, other than the design, is that you cannot remove elements from arrays. This however seemed fixed for us in version 0.7.0-alpha.1, with Material looking relatively good in all the examples we could find. The problem is however this issue, where we simply cannot build it for production. Don't really see running a JiT version of the app as an acceptable solution. Nor do I know of any work-arounds. |
@Koslun thank you. |
Could you please tell if this aot compilation issue is going to be fixed? |
Hope we can resolve this quickly. Need to use this for production apps. |
I get the same error during aot compilation but not during
It's an important issue as we can't do prod builds. Hope it gets prioritized. |
This issue is the reason I am developing my own schemabuilder. Having this issue fixed would make a huge difference for production applications 🥇 |
hey |
This workaround fixes AOT for me. In your application module, replace
with
This is for version 0.7.0-alpha.1. You can see what |
Thanks @viktor25 ! Saved my day. |
@viktor25 this solution doesn't work for me. I still have this error. |
@sasos90 Sorry, I don't have other ideas. |
Actually I have also made a post at pull request section. This is solving the problems. Please merge that pull request ASAP 😀 |
@viktor25 getting the following error when using your solution:
looks like the |
😅 my bad was using |
@RobArbor, But it still doesn't solve the production build issue right? |
@sasos90 The workaround also fixed my production build. |
i'm using angular version 5.2.0 |
I'm posting my code here as an example that implements the fix. I have a dedicated module that wraps this module, so that I can share it across other feature modules. Note that I'm using bootstrap instead of Material. Running Angular CLI: 1.6.6, Angular 5.2
|
I'm having the same issue, I used the above workaround and now my form won't display at all. |
@Koslun , Hi I downgraded to [email protected] then I am facing the below issue, or else if I upgrade it to [email protected], then I am facing below issue, if I add below lines , Could anyone of you provide any work around for this. |
@rmayuri a work-around is described in this PR: #230 (comment). I haven't tried it myself but seems legit. If you want to use version 0.6.0-alpha.7 you need to avoid using the
|
@Koslun , I have made the changes like you suggested, could you please provide any example of adding custom css for each form fields as we are not using any framework. thanks in advance |
@rmayuri we are not currently making an custom css for each form field generated by this library. We are rather just waiting to go back to using the material framework as that matches the rest of our app well. |
Thanks for your response, I am facing below issue now, it would be helpful if you could provide any inputs on this, I am trying to add widget for file upload, I followed the documentation to add new widget and added the below files but the newly added widget is not being shown in browser, Please provide any inputs to work it proper attach.component.ts import { Component, Input, OnInit } from ''; import { JsonSchemaFormService } from 'angular2-json-schema-form'; @component({ constructor( ngOnInit() { updateValue(event) { attach.component.type.ts import { WidgetLibraryService } from 'angular2-json-schema-form'; export class attachComponentType{ widgetLibrary.registerWidget('attach', AttachComponent); vendor.thirdparty.component.ts import { Component } from ''; export class VendorThirdPartyComponent { /////////// { "type": "div", ]} ] ]; public OnSubmitFn(){ console.log("OnSubmitFn "+this.myModel.RequestTitle); console.log("isValidFn "+this.myModel.RequestTitle); showValidationDialog(title, htmlData) { Thanks in advance |
@rmayuri I haven't looked into using custom controls with this library. From previous experience I wouldn't completely trust the docs though. If there is a similar example in the demos I would dig deeper into the demo source code to verify that it's the same as any other docs that you might be relying on. Btw, I would suggest wrapping any code example with the code format tag, makes reading it a lot easier and compact. Just mark the code and press the |
@viktor25 I tried the solution you posted in this thread. I still see AOT issue, here is the error I'm using a Shared Module and this is the import and export section
Using the shared module like this
Can you please tell me whats wrong? |
@pdinesh80 That sounds unrelated. Have you seen angular/components#8229 ? |
@viktor25 Thanks a lot for your quick response and the link you provided. I'll try the latest version of material and cdk. We are Angular 4.4.4 for all core angular modules, not sure I'll have any conflicts. Currently we use Let me try upgrading and comment here. Thanks again. |
@viktor25 Thank you very much. It works. |
Issue type
I'm submitting a (check one):
[x ] Bug report
[ ] Feature request
[ ] Regression (something that used to work, but stopped working in a newer version)
[ ] Support request
[ ] Documentation issue or request
Prerequisites
Before posting, make sure you do the following (check all):
[x ] Confirm you are using the latest versions of all necessary packages (or if not, explain why not)
[ x] Search GitHub for a similar issue or PR
[ x] If submitting a Support request, also search [Stack Overflow][stack-overflow] for similar issues
Note: Please cross-post GitHub support requests to [Stack Overflow][stack-overflow], and include a link in your GitHub issue to your Stack Overflow question. We do currently respond to support requests on GitHub, but we eventually expect to stop, and will then refer all support questions exclusively to Stack Overflow.
Current behavior
On AOT compilation i have this error:
Error: Error during template compile of 'AppModule' Function calls are not supported in decorators but 'JsonSchemaFormModule' was called.
Expected behavior
AOT build working
IMPORTANT: How can we reproduce your problem?
Try to aot build app with angular2-json-schema-form on angular version 5.2.1.
Environment
OS name & version: Windows 10
Browser name & version: Chrome
Angular version: 5.2.1
Angular JSON Schema Form version(s): 0.7.0-alpha.1
The text was updated successfully, but these errors were encountered: