Skip to content

Missing exports condition in @sveltejs/[email protected] #69

@Korysam15

Description

@Korysam15

Hi,

When installing and using @sveltejs/[email protected] in a Svelte + Vite project, I’m running into an error related to a missing export condition.

According to the Vite Svelte FAQ (Missing exports condition), this usually happens when the package.json is missing an "exports" field that defines the appropriate conditions (e.g., "svelte", "import", "require").

Steps to Reproduce

Create a fresh SvelteKit or Vite + Svelte project.

Install @sveltejs/[email protected]

Import and use the package in a component.

Run vite dev or vite build.

Expected Behavior
The package should resolve correctly without throwing a missing exports condition error.

Actual Behavior
Vite throws an error about a missing exports condition.

Possible Solution
Update package.json for svelte-virtual-list to include proper "exports" entries following the guidance in the Vite Svelte FAQ.

Example:

"exports": {
".": {
"types": "./dist/index.d.ts",
"svelte": "./dist/index.js",
"import": "./dist/index.js",
"require": "./dist/index.cjs",
"default": "./dist/index.js"
}
}
Thanks for looking into this!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions