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

set_custom_element_data: Cannot use 'in' operator to search for 'item' in undefined #7037

Open
TommasoAmici opened this issue Dec 21, 2021 · 9 comments

Comments

@TommasoAmici
Copy link

TommasoAmici commented Dec 21, 2021

Describe the bug

After upgrading from 3.44.2 to 3.44.3 one of the components I work on has broken with this error.

We use svelte to output custom elements.

Reproduction

https://github.com/TommasoAmici/svelte-error

Logs

Uncaught TypeError: Cannot use 'in' operator to search for 'item' in undefined

image

function set_custom_element_data(node, prop, value) {
    if (prop in node) {
        node[prop] = typeof node[prop] === 'boolean' && value === '' ? true : value;
    }
    else {
        attr(node, prop, value);
    }
}

System Info

System:
    OS: macOS 11.6
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 706.83 MB / 32.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.13.1 - /usr/local/Cellar/node@16/16.13.1/bin/node
    Yarn: 1.22.17 - /usr/local/bin/yarn
    npm: 8.1.2 - /usr/local/Cellar/node@16/16.13.1/bin/npm
    Watchman: 2021.12.20.00 - /usr/local/bin/watchman
  Browsers:
    Chrome: 96.0.4664.110
    Edge: 96.0.1054.62
    Firefox Developer Edition: 96.0
    Safari: 15.2
    Safari Technology Preview: 15.4
  npmPackages:
    rollup: ^2.61.1 => 2.61.1 
    svelte: ^3.44.3 => 3.44.3

Severity

blocking an upgrade

@ssuess
Copy link

ssuess commented Feb 16, 2022

This is also blocking for me. Is there any response or update? Thanks!

@TommasoAmici
Copy link
Author

This is still happening as of 3.46.6

@abdullahkamran
Copy link

We maintain a library of web components made in Svelte, and this issue is blocking an upgrade for us.

This issue seems to have been introduced with this PR:
#6073

@ssuess
Copy link

ssuess commented Apr 13, 2022

Is there no fix for this yet?

@geoffrich
Copy link
Member

Is someone able to provide a smaller reproduction for this? The linked repo contains 400+ lines of component code and Storybook, which will make it difficult to pinpoint the issue.

I doubt it was introduced by #6073, since a) the error is thrown before the line that PR changed and b) that change was released in 3.38.0, where this issue was introduced with 3.44.3.

@imperator-maximus
Copy link

Any progress on this issue?
As a workaround I am doing for every array refresh instead of list=list

    setTimeout(function() {           
        list=list
        },200)  

in my project. I have this now on many places in my application - makes current Svelte version not very usable to be honest.

@ssuess
Copy link

ssuess commented Jan 9, 2023

In case this helps anyone we are testing a fix (that has its own issues still) where we replace our repeating component with <svelte:self > and it seems promising

@geoffrich
Copy link
Member

@imperator-maximus @ssuess please see my comment above - we need a smaller reproduction to properly investigate this issue.

@imperator-maximus
Copy link

I cannot provide one: it seems that this only occurs in very large projects. If projects are smaller I never had such an issue.

@baseballyama baseballyama added this to the 4.x milestone Feb 26, 2023
@dummdidumm dummdidumm removed this from the 4.x milestone Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants