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?]: yarn rw sbv --build (with vite) does not seem to output a working storybook #11419

Closed
1 task
pvenable opened this issue Sep 3, 2024 · 7 comments
Closed
1 task
Labels
bug/needs-info More information is needed for reproduction topic/storybook

Comments

@pvenable
Copy link
Contributor

pvenable commented Sep 3, 2024

What's not working?

Building a (webpack-based) storybook with yarn rw sb --build works fine, and we've been using this successfully for a long time. I tried to move our storybook to vite using the recently added support and I don't seem to be able to produce a working build via yarn rw sbv --build.

As a sanity check I tried both of these commands on a fresh redwood 7.7.4 project and the results are the same -- yarn rw sb --build produces a runnable storybook build, but yarn rw sbv --build does not. I assume the storybook-vite version of this is intended to work, though I don't know this for sure. 🙂

How do we reproduce the bug?

Using Node 20 and yarn 4:

First create a new redwood project:

yarn create redwood-app storybook-issue -y
cd storybook-issue/

Build and run a webpack-based storybook, then serve it and visit localhost:8080 to see a working (albeit empty) storybook:

yarn rw sb --build
npx http-server web/public/storybook/

Now build and run a vite-based storybook instead. Serve it and visit localhost:8080 to see no storybook -- just a directory listing 😢:

yarn rw sbv --build
npx http-server web/public/storybook/

Note that I'm not reporting any problems with storybook in development: yarn rw sb and yarn rw sbv both seem to work fine.

What's your environment? (If it applies)

% node --version
v20.12.1

% yarn --version
4.3.0

% yarn rw --version
7.7.4

Are you interested in working on this?

  • I'm interested in working on this
@pvenable pvenable added the bug/needs-info More information is needed for reproduction label Sep 3, 2024
@Josh-Walker-GM
Copy link
Collaborator

Thanks @pvenable, @arimendelow do you think you'd be able to look into this one?

@arimendelow
Copy link
Contributor

Thanks @pvenable, @arimendelow do you think you'd be able to look into this one?

Yup, will do today! 😀

@arimendelow
Copy link
Contributor

@pvenable, RedwoodJS v8 was just released — would you mind giving that a try? In v8, the old Webpack version was removed, so the command for the new Vite version is just yarn rw sb :)

Also — on your test project, did you create any components? Because if not, I'm thinking that maybe nothing was built because there were no stories 😶 — and it's possible that this behavior is different between Webpack and Vite.

I've just given v8 a try (with one simple component), and had no issues. Give that a test with an empty project, and let me know what you find — for example, if you're having issues in v7 but not in v8, the solution is probably to just upgrade.

If you're still having issues in v8, however, then I definitely want to take a closer look. For example, on your primary project, are you able to run the Storybook dev server? Do you at any time see build errors? Did you have custom Storybook configs, and if so, did you migrate them over?

Here's some proof of it working on my end:
Screenshot 2024-09-03 at 20 52 06

Screenshot 2024-09-03 at 20 52 33 Screenshot 2024-09-03 at 20 51 17

@pvenable
Copy link
Contributor Author

pvenable commented Sep 4, 2024

Hi, @arimendelow, thanks for the response.

on your test project, did you create any components?

Not in this repro, but I tried that previously. In my repro instructions I tried to leave out unnecessary steps, but I should probably have mentioned that it fails even with a component. Once I was convinced of the problem I created the minimal repro instructions from scratch.

With all that said:

v8 was just released — would you mind giving that a try?

I can confirm that at least based on my repro steps v8 does indeed appear to build a working storybook 🎉, so it's possible this issue is not needed other than to direct others to upgrade to v8 if they encounter this issue on v7.

on your primary project, are you able to run the Storybook dev server? Do you at any time see build errors? Did you have custom Storybook configs, and if so, did you migrate them over?

Yes, the dev server works fine as far as I can tell. We do have custom Storybook configs, but they were pretty straightforward to port over for the vite version.

I'm glad to see that building a storybook with vite appears to work properly in v8! I look forward to upgrading our main app to v8 when I have a chance. Thanks!

@arimendelow
Copy link
Contributor

arimendelow commented Sep 4, 2024

Yay!!! Yeah, definitely post back here once you upgrade your main app and let us know how it goes 🙂

@pvenable
Copy link
Contributor Author

We've upgraded to 8.0.0 and our storybook builds/deploys successfully on vite. Thanks again! 👍

@arimendelow
Copy link
Contributor

Hooray!!!! 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/needs-info More information is needed for reproduction topic/storybook
Projects
None yet
Development

No branches or pull requests

3 participants