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
Not support Vue3 setup-script block #665
Comments
In Vue 3, when <script> tag has "setup" attribute, SFC parser assignes script block to a separate field called "scriptSetup" ✅ Closes: #665
In Vue 3, when <script> tag has "setup" attribute, SFC parser assigned script block to a separate field called "scriptSetup" ✅ Closes: #665
Thank you for a detailed issue description - it was very helpful! |
🎉 This issue has been resolved in version 6.3.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
It's so efficient! But I noticed the checker may will ignore the <script>
// normal <script>, executed in module scope (only once)
runSideEffectOnce()
// declare additional options
export default {
inheritAttrs: false,
customOptions: {}
}
</script>
<script setup>
// executed in setup() scope (for each instance)
</script> Reference from https://v3.vuejs.org/api/sfc-script-setup.html#usage-alongside-normal-script |
Thanks for reply, the situation is more complicated than I thought. #668 It's great getting support from developer of volar, believe this issue will be solved not long after. |
@piotr-oles Is there any progress? I find that 6.4.0 still does not support Vue3 setup |
We are waiting for the feature a lot. It's hard to work without type check. Especially that <script setup> is the recommended syntax if you are using Composition API |
Please have a look at the other ticket: #668 |
Hi! I was a little bit busy these days, I will take a look next week :) I'm also open for a contributions, feel free to give it a try :) |
I created PR #676 - would be nice if someone with vue project could test these changes. I added some examples to e2e tests but I'm not a vue developer, so I may miss something. To test it, clone the repo, run |
🎉 This issue has been resolved in version 7.0.0-alpha.15 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Current behavior
Config fork-ts-checker-webpack-plugin with
the ts-checker is not working with vue setup-script block.
Expected behavior
ts-checker works with setup-script block, also works when <script setup> alongside normal <script>
Reference to Vue3 document https://v3.vuejs.org/api/sfc-script-setup.html
Steps to reproduce the issue
vuejs/vue-cli#6716
vuejs/vue-cli#6736
Mannually select features: add TypeScript
run Build
Issue reproduction repository
https://github.com/curly210102/webpack-typescript-vue/tree/main
Open in StackBlitz
Issue Tracking
@vue/compiler-sfc parse methods return result
The ts-checker only handle 'script' property, ignored 'scriptSetup'.
fork-ts-checker-webpack-plugin/src/typescript-reporter/extension/vue/TypeScriptVueExtension.ts
Lines 112 to 127 in ad466df
Environment
The text was updated successfully, but these errors were encountered: