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

editor is undefined #18

Closed
ypyl opened this issue Nov 28, 2021 · 2 comments
Closed

editor is undefined #18

ypyl opened this issue Nov 28, 2021 · 2 comments

Comments

@ypyl
Copy link

ypyl commented Nov 28, 2021

Hello, thank you for the great component!

I am trying to use this web component in Elm and it is working well.
But there is one small issue if I am trying to put property value from Elm to the web component.

Sorry, I am not good at developing using web components, so perhaps I am missing something.

I am getting the following call chain when I am trying to set value property.
image

I have modified the code in index.js to check this.editor for null as it is failing without it.

And it seems that Elm somehow is able to call value property before the method connectedCallback has been called (so this.editor is null).

I am wondering if it is the issue with the web component itself (missing null check) or I am doing something wrong here.
Thank you in advance for your help!

@evanplaice
Copy link
Member

The issue is with Elm the way it handles external libraries

Specifically, Elm requires special handling to properly register web components in the global scope for usage.

See https://bigardone.dev/blog/2018/09/09/elm-and-web-components

@ypyl
Copy link
Author

ypyl commented Dec 1, 2021

thank you for the help

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

2 participants