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

AutoTitle not working using storybook 6.4.5, webpack 5 & yarn 3 #16891

Closed
amuttsch opened this issue Dec 3, 2021 · 3 comments
Closed

AutoTitle not working using storybook 6.4.5, webpack 5 & yarn 3 #16891

amuttsch opened this issue Dec 3, 2021 · 3 comments

Comments

@amuttsch
Copy link

amuttsch commented Dec 3, 2021

Describe the bug

When creating a story and using the auto title feature of CSF 3, storybook encounter the following error when opening storybook in the browser:

Error reading preview.js:
TypeError: path__WEBPACK_IMPORTED_MODULE_16___default().join is not a function
    autoTitleFromSpecifier autoTitle.js:69
    autoTitle autoTitle.js:77
    addStoriesFromExports StoryStoreFacade.js:181
    getProjectAnnotations start.js:132
    getProjectAnnotations start.js:127
    _runResolutions index.js:217
    _runResolutions index.js:214
    then index.js:67
    getProjectAnnotationsOrRenderError PreviewWeb.js:140
    initialize PreviewWeb.js:118
    configure start.js:148
    configure index.js:21
    js generated-stories-entry.js:6

To Reproduce
Check out my example repo and run:

git clone https://github.com/amuttsch/storybook-yarn3-autotitle.git
cd storybook-yarn3-autotitle
yarn install
yarn storybook

Open http://localhost:6006 and open the browser console. Storybook won't load and the console shows the error above.

I migrated the Button.stories.jsx to CSF3. The current workaround is to give the story an explicit title:

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

System
Environment Info:

System:
OS: Linux 5.15 Arch Linux
CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
Binaries:
Node: 16.13.0 - /tmp/fnm_multishells/156288_1638539582250/bin/node
Yarn: 3.1.1 - /usr/bin/yarn
npm: 8.1.0 - /tmp/fnm_multishells/156288_1638539582250/bin/npm
Browsers:
Firefox: 94.0.2

Additional context
A workaround is to install path using yarn add path or to fix the package extensions manually in .yarnrc.yml:

packageExtensions:
  "@storybook/store@*":
    dependencies:
      "path": "*"
@shilman
Copy link
Member

shilman commented Dec 6, 2021

Yay!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.4.8 containing PR #16913 that references this issue. Upgrade today to the @latest NPM tag to try it out!

npx sb upgrade

Closing this issue. Please re-open if you think there's still more to do.

@shilman shilman closed this as completed Dec 6, 2021
@amuttsch
Copy link
Author

amuttsch commented Dec 6, 2021

Version 6.4.8 fixed this issue for me, thanks for the fast PR! :-)

@shilman
Copy link
Member

shilman commented Dec 9, 2021

Whoopee!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.5.0-alpha.2 containing PR #16913 that references this issue. Upgrade today to the @next NPM tag to try it out!

npx sb upgrade --prerelease

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