question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Outros undefined when transitioning to another page

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:83 (22 by maintainers)

github_iconTop GitHub Comments

14reactions
nick-lehmanncommented, Sep 28, 2020

I can also confirm that the bug is still present in 3.28.0 and the workaround from @srinivasrk works. Until the bug is fixed, you can use @rollup/plugin-replace to automate this workaround

plugins: [
  replace({
    'outros.c.push': 'if (outros === undefined) { block.o(local); return }\noutros.c.push'
  }),
]

I know it is ugly and might break sometimes or something else, but it works for now (for me)…

14reactions
JefferyHuscommented, Nov 2, 2019

Issue is back as of 3.12.1, I am getting this error now when trying to transition to another page.

Cannot read property 'c' of undefined

function transition_out(block, local, detach, callback) {
    if (block && block.o) {
        if (outroing.has(block))
            return;
        outroing.add(block);
        outros.c.push(() => {
            outroing.delete(block);
            if (callback) {
                if (detach)
                    block.d(1);
                callback();
            }
        });
        block.o(local);
    }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Javascript page transition undefined - jquery - Stack Overflow
1 Answer 1 · Notice that I am passing a function as the second argument to the .fadeIn function. (See the API Docs.)...
Read more >
Creating a simple page transition using CSS and JavaScript
Tutorial on building a simple but sleek page transition using CSS3 transitions and animation that appears while a page is loading.
Read more >
How to Pass Data Between Pages in Ionic Apps using Angular
Learn the basic concepts of passing data from one page to another inside your Ionic apps using the Angular router. Learn...
Read more >
Intros & Outros For Content | DaBa Graphics Portfolio Project
The intro and outro bumpers used for both Vancouver Canucks and Vancouver Warriors social content. Also seen with other portfolio pieces across the...
Read more >
100+ Free Customizable Video Intro & Outro Templates - Page ...
... intro & outro templates to create a beginning and ending scene for your video that will hook the audience right away -...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found