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

No errors are reported in vue3 #783

Closed
cuihaoweb opened this issue Oct 28, 2022 · 4 comments · Fixed by #801
Closed

No errors are reported in vue3 #783

cuihaoweb opened this issue Oct 28, 2022 · 4 comments · Fixed by #801

Comments

@cuihaoweb
Copy link

Current behavior

No errors were detected in vue3

Expected behavior

Report an error in the console

Steps to reproduce the issue

This is used in vue3:

<script setup lang="ts">
const num = ref<string>(0);
const addCount = () => {
    num.value++;
}
</script>

this is webpack.config.js:

new ForkTsCheckerWebpackPlugin({
    typescript: {
        extensions: {
            vue: {
                disable: false,
                compiler: '@vue/compiler-sfc'
            }
        }
    }
}),

num is a string, but ts does not report an error after ++

Issue reproduction repository

Environment

  • "fork-ts-checker-webpack-plugin": ^7.2.13
  • "typescript": ^4.8.4
  • "ts-loader": ^9.4.1
  • "vue": "^3.2.41"
@cuihaoweb cuihaoweb added the bug label Oct 28, 2022
@timonbandit
Copy link

timonbandit commented Nov 20, 2022

@cuihaoweb I'm sure you have an error in the config.

new ForkTsCheckerWebpackPlugin({
    typescript: {
        extensions: {
            vue: {
                enabled: true,
                compiler: '@vue/compiler-sfc'
            }
        }
    }
}),

disable: false is wrong
enabled: true is correct

@tminich
Copy link

tminich commented Nov 28, 2022

I have the same issue with Vue 2.7.14 and my config is (to my understanding) correct:

{
    "async": false,
    "typescript": {
        "enabled": true,
        "extensions": {
            "vue": {
                "enabled": true,
                "compiler": "@vue/compiler-sfc"
            }
        },
        "memoryLimit": 4096,
        "profile": false,
        "diagnosticOptions": {
            "syntactic": true,
            "semantic": true,
            "declaration": false,
            "global": true
        }
    },
    "logger": {
        "infrastructure": "silent"
    }
}

@dojo-coder
Copy link

dojo-coder commented Jan 7, 2023

@timonbandit SFC script setup type checking does not work for Vue 3.
https://vuejs.org/api/sfc-script-setup.html
Works only with setup function.
This ticket is a duplicate of:
#772
This issue is currently blocking us from moving forward with esbuild as well.

@github-actions
Copy link

github-actions bot commented Mar 5, 2023

🎉 This issue has been resolved in version 8.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants