Importing routify decorators fails
rustybuddha opened this issue · comments
Description
import { TabsTransition } from "@sveltech/routify/runtime/decorators";
fails with:
[vite] Failed to resolve module import "@sveltech/routify/runtime/decorators". (imported by /src/pages/example/transitions/tabs/_reset.svelte)
Reproduction
npx svite create -t routify-mdsvex testing-svite
- copy example folder from routify-starter template
- edit all imports from @sveltech/routify to @sveltech/routify/runtime to make them work in svite
- start testing by
npm run dev
- open
localhost:3000/example/transitions/tabs/
which will throw this error in command-line:
[vite] Failed to resolve module import "@sveltech/routify/runtime/decorators". (imported by /src/pages/example/transitions/tabs/_reset.svelte)
and the page won't load - edit src/pages/example/transitions/tabs/reset.svelte to import @sveltech/routify/decorators instead of @sveltech/routify/runtime/decorators, as it was originally on copying from starter template, also ends up splashing an error, but on the webpage itself, instead of on the command-line, and it is as follows:
Failed to init component
TypeError: Cannot read property 'last' of null at Object.$$self.$$.update (http://localhost:3000/@modules/@sveltech/routify/runtime/decorators/BaseTransition.svelte?import:248:41)
Additional Information
- operating system Ubuntu based POP! OS
- versions for
- node 12.16.3
- npm 6.14.7
- svite 0.3.1
- vite ^1.0.0-rc.3
- svelte ^3.24.0
this is fixed in latest routify-mdsvex example, right?
Yes. Yes it is.
Just a note for anyone who wants to use decorators:
import TabsTransition from "@sveltech/routify/runtime/decorators/TabsTransition.svelte";
or
import { TabsTransition } from "@sveltech/routify/decorators";
is the way to do it.
Thanks.