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

Importing interface from vue component #189

Open
germanp opened this issue Jul 18, 2019 · 2 comments
Open

Importing interface from vue component #189

germanp opened this issue Jul 18, 2019 · 2 comments
Labels

Comments

@germanp
Copy link

@germanp germanp commented Jul 18, 2019

Hey,

I'm using ts-jest with vue-jest but I can't import interfaces from the .vue component files. I'm getting this error:

Module '"*.vue"' has no exported member 'Option'.

Does vue-jest support exporting interfaces? or maybe it is not related with vue-jest. Anyway, I appreciate some guidance on that. Thanks

@gumchum

Loading…

@gumchum gumchum commented Oct 3, 2019

Also running into this issue.

@JordanMajd

Loading…

@JordanMajd JordanMajd commented May 12, 2020

I think this is the same issue, if not I can split into my own. While using jest + typescript I can't import non-default exports from .vue files. Although, I have no issue doing this with other .ts files while running my standard build. The following example would produce: TS2614: Module '"*.vue"' has no exported member 'IMyComponent'. Did you mean to use 'import IMyComponent from "*.vue"' instead?

mycomponent.vue:

<template>
...
</template>
<script lang="ts">
export interface IMyComponent extends Vue {
  ...
};
export default Vue.extend({
 ...
});
</script>

mycomponent.spec.ts (compiles fine normal build, blows up when running jest):

import MyComponent, { IMyComponent } from "../mycomponent.vue";

someother.ts (compiles fine normal build):

import MyComponent, { IMyComponent } from "../mycomponent.vue";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.