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

Cannot find type definition file for 'src/vue-shims' #61

Closed
cexbrayat opened this issue Apr 13, 2020 · 3 comments
Closed

Cannot find type definition file for 'src/vue-shims' #61

cexbrayat opened this issue Apr 13, 2020 · 3 comments

Comments

@cexbrayat
Copy link
Member

Thank you for releasing this alpha so we can give it a spin!

Using alpha.1 in a TypeScript project throws a compilation error:

ERROR  Failed to compile with 2 errors                                                                                              14:58:14

error  in /Users/ced-pro/Code/vtu-next-test/node_modules/@vue/test-utils/dist/components/RouterLinkStub.d.ts

ERROR in /Users/ced-pro/Code/vtu-next-test/node_modules/@vue/test-utils/dist/components/RouterLinkStub.d.ts(1,23):
1:23 Cannot find type definition file for 'src/vue-shims'.
 > 1 | /// <reference types="src/vue-shims" />
     |                       ^
   2 | export declare const RouterLinkStub: new () => import("vue").ComponentPublicInstance<{
   3 |     to: any;
   4 | } & {}, unknown, unknown, {}, {}, Record<string, any>, import("vue").VNodeProps & {

error  in /Users/ced-pro/Code/vtu-next-test/node_modules/@vue/test-utils/dist/mount.d.ts

ERROR in /Users/ced-pro/Code/vtu-next-test/node_modules/@vue/test-utils/dist/mount.d.ts(9,9):
9:9 Property 'default' of type 'string | VNode<RendererNode, RendererElement> | { render: Function; } | undefined' is not assignable to string index type 'Slot'.
    7 |     props?: Record<string, any>;
    8 |     slots?: {
 >  9 |         default?: Slot;
      |         ^
   10 |         [key: string]: Slot;
   11 |     };
   12 |     global?: {

This can be easily reproduced in @lmiller1990 demo repo (even if the Vue CLI setup reports a more detailled error):

git clone https://github.com/lmiller1990/vtu-next-demo.git
cd vtu-next-demo
yarn
yarn tsc
@lmiller1990
Copy link
Member

lmiller1990 commented Apr 13, 2020

Yep, providing better tooling to compile the tests into JS is something we should do before the beta for sure. Good catch - I've just been running yarn jest to test things out, but for a large test suite transpiling to JS will definitely speed things up, I didn't think this far ahead.

Running yarn jest should at least yield passing tests if you want to play around.

If you want to fix this by all means send a PR :)

@lmiller1990
Copy link
Member

Related, #143 maybe. Same log with RouterStub.

@cexbrayat
Copy link
Member Author

Looks like all issues are now fixed in VTU 2.0.0-beta.0, allowing to remove skipLibCheck for those who want to.

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

No branches or pull requests

2 participants