Skip to content
This repository has been archived by the owner on Feb 1, 2022. It is now read-only.

Preview Panel Rendering #3

Open
Rahul-Khera-Codes opened this issue Mar 20, 2020 · 5 comments
Open

Preview Panel Rendering #3

Rahul-Khera-Codes opened this issue Mar 20, 2020 · 5 comments

Comments

@Rahul-Khera-Codes
Copy link

Rahul-Khera-Codes commented Mar 20, 2020

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

@merobal
Copy link
Owner

merobal commented Mar 20, 2020

Try to register the field at the lazy-loaded module

@Rahul-Khera-Codes
Copy link
Author

Rahul-Khera-Codes commented Mar 21, 2020

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

@Rahul-Khera-Codes
Copy link
Author

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

@Rahul-Khera-Codes
Copy link
Author

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.

@merobal
Copy link
Owner

merobal commented Mar 21, 2020

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!

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

No branches or pull requests

2 participants