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] Adding builder-vite to main config file launches actual app instead of playground #446

Closed
1 task
SamuelPoulin opened this issue Jul 15, 2022 · 7 comments · Fixed by #453 or #464
Closed
1 task
Labels
bug Something isn't working

Comments

@SamuelPoulin
Copy link

What version of vite are you using?

3.0.0

System info and storybook versions

System:
OS: Linux 5.10 Ubuntu 20.04.4 LTS (Focal Fossa)
CPU: (16) x64 Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz
Binaries:
Node: 16.15.1 - /usr/bin/node
Yarn: 1.22.18 - /usr/bin/yarn
npm: 8.11.0 - /usr/bin/npm

Describe the Bug

Hello, I have created a minimal repo here to reproduce the bug. Here is how to do it:

Steps:
1- Clone the repo
2- Execute yarn inside the repo
3- Execute yarn storybook inside the repo
4- Visit http://localhost:6006/ and see that the storybook playground is working just fine
5- Stop yarn storybook
6- Go to .storybook/main.ts
7- Uncomment lines 10-12 to enable builder-vite
8- Relaunch yarn storybook
9- The page hosted at localhost:6006 now displays the actual app instead of the playground

Link to Minimal Reproducible Example

: https://github.com/SamuelPoulin/vite-react-typescript-storybook-minimal

Participation

  • I am willing to submit a pull request for this issue.
@SamuelPoulin SamuelPoulin added the bug Something isn't working label Jul 15, 2022
@TPOborne
Copy link

Can confirm I'm also seeing this issue. Running yarn storybook --no-manager-cache seems to fix it temporarily. If I run yarn storybook the first time after the --no-manage-cache run then it works. Any subsequent run of yarn storybook however comes across this issue again.

@ldegen
Copy link

ldegen commented Jul 17, 2022

Hi, I think I am experiencing the same problem here. Initially, I thought this might be related to me using yarn (canary, I think), but the same thing happens with plain old npm.

@EdimarioJr
Copy link

Can confirm, I'm also seeing this issue.

@IanVS
Copy link
Member

IanVS commented Jul 21, 2022

Thanks for providing a reproduction, @SamuelPoulin, that was super helpful since I don't experience this in my own app or in the examples in this repo (I don't know why). I've found the reason this is happening, and we should have a new version with a fix out soon.

@IanVS
Copy link
Member

IanVS commented Jul 25, 2022

Thanks everyone. A fix for this has been released in @storybook/builder-vite 0.2.1.

@SamuelPoulin
Copy link
Author

I bumped the version of builder-vite in https://github.com/SamuelPoulin/vite-react-typescript-storybook-minimal and unfortunately I'm still getting this problem when uncommenting the builder...

@IanVS
Copy link
Member

IanVS commented Jul 26, 2022

Thanks, I screwed up the config it seems. For now, you can work around this by using config.appType = 'custom' in viteFinal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
5 participants