Skip to content

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

Closed as not planned

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

Activity

  1. XunJiJiang commented on May 8, 2025

    @XunJiJiang
    Author

    Upon inspection, I found that the error screenshot above does not match the issue title. This error occurs in my Electron project and cannot be easily reproduced in the browser. I will conduct more tests before deciding whether to open a new issue.

  2. locked and limited conversation to collaborators on May 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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