TanStack / TanStack/virtual

Not able to use svelte-virtual in sveltekit project (typescript)

Open
#564 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
7.1k
Forks
466
Avg merge
2d 31m
Merged PRs (30d)
13

Description

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
  • I agree to follow this project's Code of Conduct
  • 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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked StackBlitz reproduction and src/routes/+page.svelte, then install @tanstack/svelte-virtual at version 3.0.0.beta.12 and run the import shown in the issue. Trace why the SSR build cannot resolve ../../virtual-core/build/esm/index.js; done means the SvelteKit TypeScript project imports successfully without the Vite module error.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vite
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.