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

fix: getting vdom prop when vdom is not ready yet #66

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

finalclass
Copy link

@finalclass finalclass commented Dec 29, 2021

In my app something weird started to happen. I got this error message:

index.js:613 Uncaught TypeError: Cannot read property 'props' of undefined
    at HTMLElement.get (index.js:27)
(redacted)

This have been happening to me when I was using my web component like that:

<sw-text-input value="some value"/>

The weird thing is that removing the value attribute fixes it. Also any other attribute works just fine and also using this component in some other place of the app also works fine (even with the value attribute set).

For some unknown reason preact (or something else?) is trying to read the property of a component before the vdom is there, that's why we need to check for vdom existance (just like it's done in the set function).

@lfleischmann
Copy link

Hi there,

it looks like this might be related to #73? A local test using the change proposed in this PR indicated that the Svelte issue would be solved by this. Any possibility that this gets merged? Or does the change have any other unwanted consequences?

@marvinhagemeister

@jvanderberg
Copy link

Any chance this can get merged? Just here to vote for it, as it makes Svelte interop difficult, it also just feels a bit untidy - getters shouldn't throw.

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

Successfully merging this pull request may close these issues.

3 participants