AlexxNB / tinro

Highly declarative, tiny, dependency free router for Svelte's web applications.
MIT License
673 stars 30 forks source link

Route Fails on Navigation #14

Closed stolinski closed 4 years ago

stolinski commented 4 years ago
Uncaught (in promise) TypeError: Cannot read property 'c' of undefined
    at transition_out (index.mjs:751)

Seems like it's having an issue with this. Not sure if this transition_out is Svelte itself or it is tinro, but it seems to only effect the route when changed client side by clicking a link or using a goto. If you are refreshing the page, the route works just fine.

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);
    }
}

I realize this might be an odd bug and looks like a possible Svelte issue itself, https://github.com/sveltejs/svelte/issues/3165

Just wanted to let you know this is happening feel free to close.

    "svelte": "^3.22.2",
   "tinro": "^0.2.7"
AlexxNB commented 4 years ago

Can you reproduce this in REPL?

stolinski commented 4 years ago

https://github.com/stolinski/bboytools-2040 Is a reproduction, but it's a Meteor app, so I don't think REPL is possible. I totally understand if this is outside your zone, but other Svelte packages have imported and worked fine and wanted to give a heads up because I love your packages's API and would love to find some way to use it.

AlexxNB commented 4 years ago

Let's try to import this way:

// import {Route} from 'tinro';
import {Route} from 'tinro/cmp/index.js';
stolinski commented 4 years ago

Perfect. Works as expected. Thank you for your help.

jamauro commented 4 years ago

Ran into this same issue. @AlexxNB would you mind adding to the Readme? Not sure if there is something special here in the way Meteor does things.

abatros commented 2 years ago

working with tinro@0.6.7

ERROR: Uncaught TypeError: U is not a function