Open tk-90-github opened 4 days ago
I manually edit the node modules in my project and came up with following solution:
/**
* Internal representation of `$: ..`
* @param {() => any} deps
* @param {() => void | (() => void)} fn
*/
export function legacy_pre_effect(deps, fn) {
var context = /** @type {ComponentContextLegacy} */ (component_context);
/** @type {{ effect: null | Effect, ran: boolean }} */
var token = { effect: null, ran: false };
if(context.l !=null &&context.l.r1 !=null ){
context.l.r1.push(token);
}
token.effect = render_effect(() => {
deps();
// If this legacy pre effect has already run before the end of the reset, then
// bail out to emulate the same behavior.
if (token.ran) return;
token.ran = true;
if(context.l!=null && context.l.r2 !=null){
set(context.l.r2, true);
}
untrack(fn);
});
}
Edit:
Watch out for the line set(context.l.r2, true);
which was unprotected, too.
Please provide a reproduction repository. You can use stackblitz or push a github repository.
Describe the bug
Push to 'null' causes total crash of project.
The error causing line is at src/internal/client/reactivity/effect.js:270
context.l.r1.push(token);
Error message:
Reproduction
In a seperate project, which I created by the template doesn't show that effect. Sorry, I'm not so deep into svelte-internals to know how this bug can be reproduced
External libs that caused this error: "svelte-fa" "svelte-file-dropzone"
I tried to add some icons with Fa in the basic example but it doesn't show the effect I face in production.
Logs
System Info
Severity
blocking all usage of svelte