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

[Bug]: Vue. export props from vue component #24621

Closed
Flashantik opened this issue Oct 30, 2023 · 3 comments
Closed

[Bug]: Vue. export props from vue component #24621

Flashantik opened this issue Oct 30, 2023 · 3 comments

Comments

@Flashantik
Copy link

Describe the bug

if you export props from .vue component and try to use it in another component, you will get an error

[vite] Internal server error: Unexpected token, expected "," (1:8)
Plugin: storybook:vue-docgen-plugin

import { defineComponent as _defineComponent } from "vue";

To Reproduce

https://stackblitz.com/edit/github-egkjhp?file=src%2Fcomponents%2Fsubmit-button.stories.ts

System

The same result on [email protected]

Storybook Environment Info:

  System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.18.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 9.4.2 - /usr/local/bin/npm <----- active
    pnpm: 8.9.2 - /usr/local/bin/pnpm
  npmPackages:
    @storybook/addon-essentials: ^7.6.0-alpha.2 => 7.6.0-alpha.2 
    @storybook/addon-interactions: ^7.6.0-alpha.2 => 7.6.0-alpha.2 
    @storybook/addon-links: ^7.6.0-alpha.2 => 7.6.0-alpha.2 
    @storybook/blocks: ^7.6.0-alpha.2 => 7.6.0-alpha.2 
    @storybook/testing-library: ^0.2.2 => 0.2.2 
    @storybook/vue3: ^7.6.0-alpha.2 => 7.6.0-alpha.2 
    @storybook/vue3-vite: ^7.6.0-alpha.2 => 7.6.0-alpha.2 
    storybook: ^7.6.0-alpha.2 => 7.6.0-alpha.2

Additional context

No response

@thomasaull
Copy link

thomasaull commented Nov 20, 2023

In my project weirdly it works when I use an alias for the import:

This does not work:

import MyComponent, { type Props } from './MyComponent.vue'

This works:

import MyComponent, { type Props } from '@/components/MyComponent.vue'

@larsrickert
Copy link
Contributor

Hey, this will be fixed with #22285

@larsrickert
Copy link
Contributor

Fixed with #22285 in version 8

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

4 participants