Storybook: Storybook crashes on latest version (SyntaxError: Unexpected token '.')

Created on 13 Aug 2020  路  10Comments  路  Source: storybookjs/storybook

The storybook project builds fine:
image

When I load the page I get a cryptic Javascript error:
image

My deps are as below (let me know if there are other relevant deps):

    "@storybook/addon-a11y": "^6.0.5",
    "@storybook/addon-actions": "^6.0.5",
    "@storybook/addon-knobs": "^6.0.5",
    "@storybook/addon-links": "^6.0.5",
    "@storybook/addons": "^6.0.5",
    "@storybook/react": "^6.0.5",
    "@storybook/source-loader": "^6.0.5",
    "react": "16.13.1",

Not really sure where to start debugging, any ideas on what could be wrong?

P1 bug core help wanted

Most helpful comment

@TheKnarf

All 10 comments

do you have a repro i can look at? i recently updated that part of the code and it's possible that you're hitting some kind of corner case bug

do you have a repro i can look at? i recently updated that part of the code and it's possible that you're hitting some kind of corner case bug

I went through and disabled story by story until I found the one causing the crash. It was below, where Toaster is a function which has to be called as Toaster.create();

export default {
    title: 'Toaster',
    component: Toaster,
};

My mistake, thanks for having a look at the issue. I'll leave the issue open if you want to take further action. @shilman

I had a similar problem in a project after upgrading Storybook, turned out I head a react component called delete in a file called delete.tsx and at some point Storybook tried to generate some code that looked something like delete.module = ... which caused the SyntaxError. Renaming the component and the file solved it (never checked which one was the problem).

@TheKnarf

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@TheKnarf nailed this one. A file named delete.tsx causes this failure mode.

Same issue here.
In my case instead of having a file delete.tsx I had a switch.tsx which caused the same problem:
(SyntaxError: Unexpected token '.')

Yep, exactly the same issue here - I have switch.tsx which causes the same problem. Changing the file name to somethingElse.tsx everything compiles fine

Same issue, (SyntaxError: Unexpected token '.') and switch.tsx :D

switch.tsx too!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

purplecones picture purplecones  路  3Comments

arunoda picture arunoda  路  3Comments

ZigGreen picture ZigGreen  路  3Comments

Jonovono picture Jonovono  路  3Comments

MrOrz picture MrOrz  路  3Comments