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

Why ts error in .vue file can not be displayed in Vite HMR overlay #4393

Closed
6 tasks done
duola8789 opened this issue Jul 26, 2021 · 5 comments
Closed
6 tasks done

Why ts error in .vue file can not be displayed in Vite HMR overlay #4393

duola8789 opened this issue Jul 26, 2021 · 5 comments

Comments

@duola8789
Copy link

Describe the bug

My IDE is Webstorm, I can get ts error in Typescript terminal, but it can not be dispalyed in Vite HMR overlay

export default defineComponent({
    name: 'App',
    components: {
        HelloWorld
    },
    setup() {
        const a = ref<string>(22223);
        a.value = 22212;
        return {a};
    }
});

image

And Vite HMR overlay also doesn't show the error

image

is is possible to show the error on broswer just like Vue CLI?

image

Reproduction

export default defineComponent({
    name: 'App',
    components: {
        HelloWorld
    },
    setup() {
        const a = ref<string>(22223);
        a.value = 22212;
        return {a};
    }
});

System Info

System:
    OS: macOS Mojave 10.14.6
    CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
    Memory: 67.25 MB / 8.00 GB
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 12.16.3 - /usr/local/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.4 - /usr/local/bin/npm
  Browsers:
    Chrome: 90.0.4430.93
    Firefox: 63.0.3
    Safari: 13.0.1
  npmPackages:
    @vitejs/plugin-vue: ^1.2.2 => 1.2.5 
    vite: ^2.3.3 => 2.4.3

Used Package Manager

yarn

Logs

No response

Validations

@nrayburn-tech
Copy link

Check the typescript section here. https://vitejs.dev/guide/features.html#typescript.

There might be a plug-in that can be used to accomplish this.

@duola8789
Copy link
Author

Check the typescript section here. https://vitejs.dev/guide/features.html#typescript.

There might be a plug-in that can be used to accomplish this.

I followed the description of typescript section, and use vite-plugin-checker to accomplish it, but it's still not worked

@gustaff-weldon
Copy link

@duola8789 I have used the vite-plugin-checker with its default config and it worked fine for me:

   import checker from 'vite-plugin-checker';
   ....
    plugins: [
      checker({ typescript: true })
   ]

@duola8789
Copy link
Author

@duola8789 I have used the vite-plugin-checker with its default config and it worked fine for me:

   import checker from 'vite-plugin-checker';
   ....
    plugins: [
      checker({ typescript: true })
   ]

I tried, but it didn't work for me. However, vite-plugin-checker updated 3 days ago and I set vls to be true, it works now.

thanks anyway

@haoqunjiang
Copy link
Member

I'm closing this issue because the behavior matches the documentation, thus not a bug.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants