Open tjx666 opened 4 years ago
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.
SFCDescriptor in component-compiler-utils:![screenshot_2020-05-18_11-37-30](https://user-images.githubusercontent.com/41773861/82172159-ff8f0e00-98fb-11ea-88f6-c3d2d8333152.png)
SFCDescriptor in vue-template-compiler:![screenshot_2020-05-18_11-37-30](https://user-images.githubusercontent.com/41773861/82172329-6f04fd80-98fc-11ea-9347-316cdeef356f.png)
result: