virtual
virtual copied to clipboard
Not able to use svelte-virtual in sveltekit project (typescript)
Describe the bug
Facing the below error while trying to import in a svelte-kit project written in typescript. I installed svelte-virtual using pnpm. Please help.
22:26:53 [vite] Error when evaluating SSR module /src/routes/dashboard/+page.svelte: failed to import "@tanstack/svelte-virtual" |- Error: Cannot find module '../../virtual-core/build/esm/index.js'
Your minimal, reproducible example
https://stackblitz.com/edit/github-r5vxpy?file=src%2Froutes%2F%2Bpage.svelte
Steps to reproduce
Just install and import using
import { createVirtualizer } from '@tanstack/svelte-virtual';
Expected behavior
This error should not be shown.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
stackblitz, microsoft edge
tanstack-virtual version
3.0.0.beta.12
TypeScript version
5.0.0
Additional context
No response
Terms & Code of Conduct
- [X] I agree to follow this project's Code of Conduct
- [X] I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
This particular issue has been resolved at least since version 3.0.0-beta.54
. If you pin that version this error no longer appears. There are still a bunch of npm install errors related to peer dependencies w/r/t svelte 3 vs 4 but npm seems to resolve them automatically (haven't investigated, just getting started with this package).
Fixed stackblitz: https://stackblitz.com/edit/github-r5vxpy-km3dgd?file=package.json
It is not supported for svelte 4
I'm on 3.0.0-beta.66
using SvelteKit with TS and everything resolves correctly–other than ✕ unmet peer svelte@^3.48.0: found 4.2.8
which is fixed in the latest alpha
Svelte 4 support was added in 3.0.0-beta.69
. Upgrading to the latest version, currently 3.0.1
, should solve the peer dependency issue.