Skip to content

Type based boolen prop declaration compiles to JS string when use imported TS type #14292

@EvgeniyShigartsov

Description

@EvgeniyShigartsov

Vue version

^3.5.17

Link to minimal reproduction

https://play.vuejs.org/#eNrtVdtu2kAQ/ZWVH2oiJbaqNKpKHdpQRWp6SaImah/qKDJ4MJvau9u9UCLCv3dmjQkQoFUfIlWKkBA713Nm5yyT4EipaOQgaAeJ6WuuLDNgnWJlJorDNLAmDTqp4JWS2rIJ0zBgUzbQsmIhpoVz1/E4q1QJ37gddl0xi4jiZTN1Cl+vy5HObkirPU0mffpSGMu4UM6yQ0LUCsOdVCRxTQDh4sECFsgs4ImxZAXdaK+SOZTIz1dJA6Tb82eoA9Gi4afjGvJOskLiQcUZ9n8vWhfAukm8ADvYxekj1wEvohsjBV7RhFqnQV9Wipegz5TlOIs0aDPvIV9WlvLXB2+z2sFuY+8Pof9jjf3GjMmWBucaDOgRopz7bKYLQCLkPr44hTH+njuRrCNOW5xfwMjSEcY6rOtEjrAX4jzaE78NXBSX5nhsQZiGFAGlyKmPTwPcgXdbqN/D3Y9e+LxUTHGKa5fp7xbe3irArT+hC31/+fnTkbWa95wFs6KCVMQxiwUuwHXN3cRv0RNrJyyvYC+XVZxzYxcNUR5hN0r0bbpSlpAJboa41b36wO5YSFMI6ccgK40XgQ+vpwb5JR0O10H8HjbrFl4x7LLQ4I7hVcCAC8hn5S6yCqhU19lTaZviW5EQ6xoK9e5mBs61VAZz/JWQ6017PTDyhVcUhdveh6Esc9CbghdC6hzk0jCjnMVBEE1XtNlMIoZZyVBS9pYZLCiKXWaQKOODpQrbZ0ctF6I3TAo7n31cbkzziv2scBHn01oakn8i2jNwZOiXmTGbMHknAZqyZytTv38Y1ax+fb/emfjvTusPr2TOR6zte6AQfJnIn7wiSGOJ6sxUxHquSGLV2I3KRAdnRCPyABg3qMxJDSZqpheNstLB2aC1E1l54Tm3dth0yhAVVfAoUCej1bfQv4YP/0ueRPz/ivixFbz8aDyJ+JEVjPq9HoGm/3ZU7X50ED1/STZrvs6tB9GraD+Y/gbbg7jR

Steps to reproduce

  1. Open link with example
  2. Check on the UI result of "required" compilation (ExampleWithoutBug.vue)
  3. Check on the UI result of "required" compilation (ExampleWithBug.vue)

What is expected?

required prop in both of examples compiles to JS boolean type

What is actually happening?

required prop in ExampleWithBug.vue compiles to JS empty string

System Info

System:
    OS: macOS 14.4.1
    CPU: (8) arm64 Apple M1
    Memory: 160.03 MB / 8.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.15.0 - /Users/me/.nvm/versions/node/v22.15.0/bin/node
    npm: 10.9.2 - /Users/me/.nvm/versions/node/v22.15.0/bin/npm
  Browsers:
    Chrome: 143.0.7499.170
    Safari: 17.4.1
  npmPackages:
    vue: ^3.5.17 => 3.5.22

Any additional comments?

Is this should happen by design or you can fix that bug in future ? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    🔨 p3-minor-bugPriority 3: this fixes a bug, but is an edge case that only affects very specific usage.scope: sfc

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions