merobal / angular-formio-custom-demo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Preview Panel Rendering

upexcel opened this issue · comments

The Preview Panel doesn't render the component when using formio in a lazy loaded module.
And if an add the rating field in lazy loaded formio it doesn't load.
The Git Link
I've deployed it on Netlify

Try to register the field at the lazy-loaded module

When I register the field in app module and as well as lazy loaded module
I get this error
ERROR Error: Uncaught (in promise): NotSupportedError: Failed to execute 'define' on 'CustomElementRegistry': the name "my-rating" has already been used with this registry
Error: Failed to execute 'define' on 'CustomElementRegistry': the name "my-rating" has already been used with this registry

I tried to create a rating-wrapper module and register it there only and then export the rating-wrapper module to different module and still I get the same error

I've updated the git repo with two branches in it.

  1. Branch: registeringFieldInMultipleModule Registering formio field in multiple modules
  2. Branch: ratingExportModule In this I created a module for rating-wrapper component and then register the field there only and then imported that in separate module.
    these two result in same error as listed above.

Try to write an adapter register only once as how the error message says (a new function which knows the "registered state" somehow), then try to register at the lazy-loaded module.
Also please note if you need more support please file a new issue under the original repo, this is for the demo only. Thanks!