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

$inspect destroying reactivity #13146

Closed
Kapsonfire-DE opened this issue Sep 5, 2024 · 2 comments · Fixed by #13153
Closed

$inspect destroying reactivity #13146

Kapsonfire-DE opened this issue Sep 5, 2024 · 2 comments · Fixed by #13153
Assignees
Labels

Comments

@Kapsonfire-DE
Copy link
Contributor

Kapsonfire-DE commented Sep 5, 2024

Describe the bug

From this discord thread: https://discord.com/channels/457912077277855764/1280993749673181237

User posted REPL where reactivity behaves weird/incosistent. Breaking down and doing some changes I saw, that removing the $inspect lines from REPL make the reactivity work.

Reproduction

Original with issue: https://svelte-5-preview.vercel.app/#H4sIAAAAAAAACp1XbW_bNhD-Kwc1wSRPlZW0-aJYDrphQD-sQxEM2IooGGiJtojKlCDSsQRB_304vujFdjJ0KFBTd7wXPvfckemcLSuocKKnzuFkT53I-VRVju_ItsIP8UILSR3fEeWhTlGyEmnNKgkF4bs4caRInHXCE5kWRAh4pKmEDr8T2UAM4b1et5P1kWUyn3znlO1yaQVKlJZcyPqQyrJ2lRsfWv0zGPsw2nk2ZCJlzkSAJs39TITm7VxkXanfuWpwrRdG2dv0dlRCjQp3Ermm8lBzMAn8DGOMS-abUspy_5p9a-3P4uv_sDrwtRRMspJDPCAeAT_sN7S2qM--ewOvrtQfZUbH4FUpIIYrIYmkbgdNpCCPIITeU8bvLFpmz00YGsWAldHcGUWNVIjhKqM1e6GZy-lR0cNVB6tKETQ-DOvWrHUc-6F9e55FTlCpy-UeT2s-JHicoqXB1iavYP3utEYmjo7t5meBRnKcRzJGr4W6TKcp27s53fFAN2EI_lEveix2f5qSAhM5fyZVtH8t_VfwOyEbT-RyscAfWMCjPQ2FA0fulVvYHwrJqoLCpjzwjPEdYOkJ3xVUBNpuiT-0qcpawvbAU0Vb5cDFvZEihg9BEOCn0N9Pz140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4y9myTH5CTVrwOFGC6B1TojX53gi7U0LMZE1VBcOYXZfrddqB5BpjmMZu3JP2-r3GKfUjLoqzRhgw227LOaH1OU5EM514EoX-nqqKkB1LvGbdCCK1GHUMl_3bcfU3t86cyr7cIaloQyZ7pay9YenszckFlBDdjFqM52YqyOEpqFEFwGjYXhRtCeAW3d1feGMbn5XvJaqvb8Ao-hlfe-3F7Nb5MuZylcygztmM0cyJZH2n_1P8LDGATVb4QAAA=

Logs

No response

System Info

-

Severity

blocking all usage of svelte

@paoloricciuti
Copy link
Member

I have a slightly less involved reproduction here...curiously at least in my reproduction an error is correctly thrown but is still weird (it says derived can't reference itself) but it's a bit weird. I'll try to explore this a bit more but if someone else want to take a shot feel free to do it.

@paoloricciuti
Copy link
Member

@trueadm i have a theory about this but i want to know if it's true...could it be that since $inspect runs immediately per comment here

// Inspect effects need to run immediately, so that the stack trace makes sense
if (DEV && (flags & INSPECT_EFFECT) !== 0) {
    inspect_effects.add(reaction);
    continue;
}

it runs while still inside the derived hence registering a dependency for the derived too? Because i suspect that the whole problem here is that (only when using inspect) you map over nodes reading rect so the derived has a dependency both on each node and each rect inside node. But when you add a new one it also has a dependency on that new one and it update the rect derived while rects is still in the derived stacks.

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

Successfully merging a pull request may close this issue.

3 participants