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

Vue SFC TS check was broken on vue2.7 #765

Closed
iceprosurface opened this issue Jul 19, 2022 · 1 comment
Closed

Vue SFC TS check was broken on vue2.7 #765

iceprosurface opened this issue Jul 19, 2022 · 1 comment
Labels

Comments

@iceprosurface
Copy link

Current behavior

https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/blob/main/src/typescript/extension/vue/type-script-vue-extension.ts#L113

vue2.7 hit isVueTemplateCompilerV3,but there is no descriptor on parsed

const parsed = compiler.parse(vueSourceText);

if (parsed.descriptor && parsed.descriptor.script) {
  const scriptV3 = parsed.descriptor.script;

parsed shows like following codes

 {
  source: undefined,
  filename: 'anonymous.vue',
  template: null,
  script: null,
  scriptSetup: null,
  styles: [],
  customBlocks: [],
  cssVars: [],
  errors: [],
  shouldForceReload: [Function (anonymous)]
}

So that any ts check on vue will fail.

export { default as FilteredSearchToken } from './FilteredSearchToken.vue';

image

Error shows:

TS2322: Type '{}' is not assignable to type 'VueConstructor<Vue<Record<string, any>, Record<string, any>, never, never, never, never, (event: string, ...args: any[]) => Vue<Record<string, any>, Record<string, any>, ... 4 more ..., ...>>>'.

Expected behavior

Checker should work fine.

Steps to reproduce the issue

yarn serve

Issue reproduction repository

https://github.com/iceprosurface/vue2.7-tsx-error

Environment

iceprosurface added a commit to iceprosurface/fork-ts-checker-webpack-plugin that referenced this issue Jul 19, 2022
iceprosurface added a commit to iceprosurface/fork-ts-checker-webpack-plugin that referenced this issue Jul 21, 2022
iceprosurface added a commit to iceprosurface/fork-ts-checker-webpack-plugin that referenced this issue Jul 21, 2022
iceprosurface added a commit to iceprosurface/fork-ts-checker-webpack-plugin that referenced this issue Jul 21, 2022
iceprosurface added a commit to iceprosurface/fork-ts-checker-webpack-plugin that referenced this issue Sep 4, 2022
@piotr-oles
Copy link
Collaborator

I'm dropping support for Vue.js. For the last few years, support for Vue.js has been broken, and the implementation of Vue.js integration was a hacky work-around. Unfortunately, TypeScript doesn't expose an API to do that properly, and while I created a microsoft/TypeScript#38736 on the TypeScript repository, the TypeScript team has other priorities. As I won't have time to support this feature and am receiving justified bug reports, I believe it's better to make it clear that Vue.js is not supported by the plugin instead of pretending that it is.

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

No branches or pull requests

2 participants