Skip to content

Outros undefined when transitioning to another page #3165

Closed
@matyunya

Description

@matyunya

Couldn't get a REPL repro but If I try to navigate from https://smelte-8z4ib07lj.now.sh/components/tabs to any other page I get this error:

index.mjs:629 Uncaught (in promise) TypeError: Cannot read property 'callbacks' of undefined
    at U (index.mjs:629)
    at Object.o (Waypoint.svelte:116)
    at hn (index.mjs:761)
    at Object.o (Image.svelte:27)
    at hn (index.mjs:761)
    at Object.o (tabs.c766b77c.js:1)
    at hn (index.mjs:761)
    at Object.o (TabButton.svelte:11)
    at hn (index.mjs:761)
    at Object.o (Tab.svelte:6)
</details>

At this line:

function transition_out(block, local, callback) {
    if (block && block.o) {
        if (outroing.has(block))
            return;
        outroing.add(block);
        **outros.callbacks.push(() => {**
            outroing.delete(block);
            if (callback) {
                block.d(1);
                callback();
            }
        });
        block.o(local);
    }
}

Works https://smelte-8z4ib07lj.now.sh/components/tabs

Doesn't https://smelte-ocubxglhw.now.sh/components/tabs

Not sure what causes the error so I simply patched it by adding an extra check if outros.callbacks is set.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions