Svelte Import Issues

I’m seeing

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

When attempting to use https://github.com/AlexxNB/tinro

I’ve found https://github.com/meteor-svelte/meteor-svelte/issues/33 but it seems like the issue was resolved by moving svelte to devDeps, where it already is in this case.

Anyone have thoughts here? This Tinro router looks fantastic, also if I’m hitting this snag now, I’m sure a ton of other potential new Svelte devs with Meteor might have issues.

Any insights @arggh ?

A solution was to import {Route} from 'tinro/cmp/index.js'; but that’s a bummer that it fails with the standard import.

I answered in the Github issue, but for sake of archiving, here’s a copy-paste:


the repro seems to be working fine for me, which is why I think you’re encountering the caching issue related to svelte:compiler not considering the used Svelte version when using the compiler cache. Perhaps you updated the Svelte version at some point?

You should install the latest svelte:compiler@4.0.0-beta.1 and do a meteor reset to get rid of the stale cache corrupting your bundle.

I also switched the import to reference a package instead of the entry point and all works:

Also, I just noticed you have a version mismatch regarding svelte:compiler and the installed version of svelte .

Better to use svelte:compiler@4.0.0-beta.1 so that the compiler always uses the same version as your app.

The path of a Meteor/Svelte-developer is currently rigged with several booby traps…

As a sidenote, I don’t think Meteor leverages the pkg.svelte field in any meaningful way, but if you include a symlink to the package in /imports that might give you some of the same benefits.

1 Like