Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript inline type annotation in Vue SFC with Pug be compiled wrong when $vite #10512

Closed
7 tasks done
wzh19960613 opened this issue Oct 18, 2022 · 1 comment
Closed
7 tasks done
Labels
duplicate This issue or pull request already exists

Comments

@wzh19960613
Copy link

Describe the bug

<template lang="pug">
MyComponent(
    v-model="someReactive['abc'] as any"
    :myProp="(someProp as number).toFixed()"
)
</template>

This can work well when $vite build and $vite preview, but will be compiled to js codes like below when $vite:

// ...
_createVNode($setup["MyComponent"], {
    modelValue: $setup.someReactive['abc'] as any,
    myProp: $props.(someProp as number).toFixed()
}, /* ... */ )
// ...

Hence I can't debug the project as usual.

Reproduction

https://stackblitz.com/edit/vitejs-vite-bzofkr?file=App.vue

Steps to reproduce

No response

System Info

System:
    OS: macOS 12.6
    CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
    Memory: 609.39 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 17.8.0 - /usr/local/bin/node
    Yarn: 1.22.18 - /usr/local/bin/yarn
    npm: 8.6.0 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Browsers:
    Chrome: 106.0.5249.119
    Firefox: 81.0
    Safari: 16.0
  npmPackages:
    @vitejs/plugin-vue: ^3.1.2 => 3.1.2 
    vite: ^3.1.8 => 3.1.8

Used Package Manager

yarn

Logs

No response

Validations

@sapphi-red
Copy link
Member

Duplicate of vitejs/vite-plugin-vue#18

@sapphi-red sapphi-red closed this as not planned Won't fix, can't repro, duplicate, stale Oct 18, 2022
@sapphi-red sapphi-red added invalid This doesn't seem right duplicate This issue or pull request already exists and removed pending triage invalid This doesn't seem right labels Oct 18, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Nov 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants