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

build error when use vue3 .vue file lang="tsx" #15784

Closed
XuXuejian opened this issue Aug 7, 2021 · 2 comments
Closed

build error when use vue3 .vue file lang="tsx" #15784

XuXuejian opened this issue Aug 7, 2021 · 2 comments

Comments

@XuXuejian
Copy link

Describe the bug
build error when use vue3 .vue file and lang="tsx"

To Reproduce
see at https://github.com/XuXuejian/storybook-vue3-tsx

System

    OS: Windows 10 10.0.19042
    CPU: (4) x64 Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz
  Binaries:
    Node: 14.15.1 - E:\Program Files (x86)\nodejs\node.EXE
    Yarn: 1.22.11 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 6.14.8 - E:\Program Files (x86)\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1023.0), Chromium (92.0.902.62)
  npmPackages:
    @storybook/addon-actions: ^6.3.6 => 6.3.6
    @storybook/addon-essentials: ^6.3.6 => 6.3.6
    @storybook/addon-links: ^6.3.6 => 6.3.6
    @storybook/builder-webpack5: ^6.3.6 => 6.3.6
    @storybook/manager-webpack5: ^6.3.6 => 6.3.6
    @storybook/vue3: ^6.3.6 => 6.3.6

Error Info

SyntaxError: F:\learn\storybook\sb-tsx2\src\stories\Button.vue: A class name is required. (40:14)
         }
         return () => type = "button";
       class {
              ^
         }
         {
            classes.value;
    at Object._raise (F:\learn\storybook\sb-tsx2\node_modules\@babel\parser\lib\index.js:796:17)
    at Object.raiseWithData (F:\learn\storybook\sb-tsx2\node_modules\@babel\parser\lib\index.js:789:17)
    at Object.raise (F:\learn\storybook\sb-tsx2\node_modules\@babel\parser\lib\index.js:750:17)
    at Object.unexpected (F:\learn\storybook\sb-tsx2\node_modules\@babel\parser\lib\index.js:3257:16)
    at Object.parseClassId (F:\learn\storybook\sb-tsx2\node_modules\@babel\parser\lib\index.js:13886:14)
    at Object.parseClass (F:\learn\storybook\sb-tsx2\node_modules\@babel\parser\lib\index.js:13562:10)
    at Object.parseStatementContent (F:\learn\storybook\sb-tsx2\node_modules\@babel\parser\lib\index.js:12848:21)
    at Object.parseStatement (F:\learn\storybook\sb-tsx2\node_modules\@babel\parser\lib\index.js:12806:17)
    at Object.parseBlockOrModuleBlockBody (F:\learn\storybook\sb-tsx2\node_modules\@babel\parser\lib\index.js:13395:25)
    at Object.parseBlockBody (F:\learn\storybook\sb-tsx2\node_modules\@babel\parser\lib\index.js:13386:10)
    at Object.parseBlock (F:\learn\storybook\sb-tsx2\node_modules\@babel\parser\lib\index.js:13370:10)
    at Object.parseFunctionBody (F:\learn\storybook\sb-tsx2\node_modules\@babel\parser\lib\index.js:12254:24)
    at Object.parseFunctionBodyAndFinish (F:\learn\storybook\sb-tsx2\node_modules\@babel\parser\lib\index.js:12238:10)
    at Object.parseMethod (F:\learn\storybook\sb-tsx2\node_modules\@babel\parser\lib\index.js:12188:10)
    at Object.parseObjectMethod (F:\learn\storybook\sb-tsx2\node_modules\@babel\parser\lib\index.js:12116:19)
    at Object.parseObjPropValue (F:\learn\storybook\sb-tsx2\node_modules\@babel\parser\lib\index.js:12149:23)
    at processResult (F:\learn\storybook\sb-tsx2\node_modules\@storybook\builder-webpack5\node_modules\webpack\lib\NormalModule.js:713:19)
    at F:\learn\storybook\sb-tsx2\node_modules\@storybook\builder-webpack5\node_modules\webpack\lib\NormalModule.js:819:5
    at F:\learn\storybook\sb-tsx2\node_modules\@storybook\builder-webpack5\node_modules\loader-runner\lib\LoaderRunner.js:399:11
    at F:\learn\storybook\sb-tsx2\node_modules\@storybook\builder-webpack5\node_modules\loader-runner\lib\LoaderRunner.js:251:18
    at context.callback (F:\learn\storybook\sb-tsx2\node_modules\@storybook\builder-webpack5\node_modules\loader-runner\lib\LoaderRunner.js:124:13)
    at F:\learn\storybook\sb-tsx2\node_modules\babel-loader\lib\index.js:59:103
@shilman
Copy link
Member

shilman commented Aug 7, 2021

I believe this was recently added for vue2 here: #11936

Is there any chance you can submit a PR to add it for vue3?

@shilman
Copy link
Member

shilman commented Jun 7, 2023

We’re cleaning house! Storybook has changed a lot since this issue was created and we don’t know if it’s still valid. Please open a new issue referencing this one if:

@shilman shilman closed this as not planned Won't fix, can't repro, duplicate, stale Jun 7, 2023
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