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 definition for SFCDescriptor isn't compatible with vue-template-compiler #88

Open
tjx666 opened this issue May 18, 2020 · 1 comment

Comments

@tjx666
Copy link

tjx666 commented May 18, 2020

SFCDescriptor in component-compiler-utils:
screenshot_2020-05-18_11-37-30

SFCDescriptor in vue-template-compiler:
screenshot_2020-05-18_11-37-30

result:

Type 'typeof import("c:/code/vscode-fe-helper/node_modules/vue-template-compiler/types/index")' is not assignable to type 'VueTemplateCompiler'.
  The types of 'parseComponent(...).template' are incompatible between these types.
    Type 'SFCBlock | undefined' is not assignable to type 'SFCBlock | null'.
      Type 'undefined' is not assignable to type 'SFCBlock | null'

screenshot_2020-05-18_11-37-30

@simonhaenisch
Copy link

simonhaenisch commented Jul 16, 2021

Similar issue for SFCBlock:

const { parse } = require('@vue/component-compiler-utils');
const compiler = require('vue-template-compiler');

const parsed = parse({
  source,
  compiler, // <-- TypeScript complains here
});
Type 'typeof import("node_modules/vue-template-compiler/types/index")' is not assignable to type 'VueTemplateCompiler'.
  The types of 'parseComponent(...).template' are incompatible between these types.
    Type 'import("node_modules/vue-template-compiler/types/index").SFCBlock' is not assignable to type 'import("node_modules/@vue/component-compiler-utils/dist/parse").SFCBlock'.
      Property 'start' is optional in type 'SFCBlock' but required in type 'SFCBlock'.

Everything runs fine though, it's just a type incompatibility.

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

No branches or pull requests

2 participants