Skip to content

Error: Stripping types is currently unsupported for files under node_modules (.d.mts in dist) #5066

@cheungray123

Description

@cheungray123

UnoCSS version

66.5.12

Describe the bug

在使用 SvelteKit + Vite + @unocss/svelte-scoped 时,开发服务器启动报错:

Error [ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING]: Stripping types is currently unsupported for files under node_modules, for "file:///.../node_modules/@unocss/svelte-scoped/dist/types-xxxxxx.d.mts"

Reproduction

  1. 安装 @unocss/svelte-scoped@66.5.12 和 unocss@66.5.12

  2. 使用 SvelteKit@2.49.1、Vite@7.2.6

  3. 启动开发服务器 pnpm run dev

  4. 立即报错,无法启动

System Info

Node.js 版本:v24.11.0
SvelteKit 版本:2.49.1
Vite 版本:7.2.6
@unocss/svelte-scoped 版本:66.5.12
建议
请在发布包时移除 dist 目录下的 .d.mts 文件,仅保留 .js 和 .d.ts 文件,或兼容 Vite/SvelteKit 的类型处理方式。

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions