Skip to content

Type-only defineProps and defineEmits cause a compiler-sfc error when using path aliases #13294

Closed as not planned
@XunJiJiang

Description

@XunJiJiang

Vue version

3.5.13

Link to minimal reproduction

https://github.com/XunJiJiang/Error-of-Type-only-define

Steps to reproduce

Type-only defineProps and defineEmits cause a compiler-sfc error when using path aliases.

What is expected?

Correct type resolution

What is actually happening?

An [@vue/compiler-sfc] error occurs when using path aliases from vite.config in App.vue, while relative or absolute paths are resolved correctly.

Image

System Info

System:
    OS: macOS 15.4.1
    CPU: (14) arm64 Apple M4 Max
    Memory: 436.31 MB / 36.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.13.0 - ~/.nvm/versions/node/v22.13.0/bin/node
    Yarn: 1.22.22 - ~/.nvm/versions/node/v22.13.0/bin/yarn
    npm: 11.0.0 - ~/.nvm/versions/node/v22.13.0/bin/npm
    pnpm: 10.6.3 - ~/.nvm/versions/node/v22.13.0/bin/pnpm
    bun: 1.2.2 - ~/.bun/bin/bun
  Browsers:
    Chrome: 136.0.7103.92
    Safari: 18.4
  npmPackages:
    vue: 3.5.13 => 3.5.13

Any additional comments?

No response

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