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

open storybook-server/.storybook/preview.js: no such file or directory #1018

Closed
pigletfly opened this issue Dec 20, 2024 · 2 comments · Fixed by #1024
Closed

open storybook-server/.storybook/preview.js: no such file or directory #1018

pigletfly opened this issue Dec 20, 2024 · 2 comments · Fixed by #1024
Labels
bug Something isn't working

Comments

@pigletfly
Copy link

Describe the bug
run run.sh under storybook/_example, it outputs errors

{"level":"info","ts":"2024-12-20T22:41:50+08:00","caller":"storybook/storybook.go:94","msg":"Installing storybook."}
{"level":"info","ts":"2024-12-20T22:41:50+08:00","caller":"storybook/storybook.go:187","msg":"Storybook already installed, Skipping installation."}
{"level":"info","ts":"2024-12-20T22:41:50+08:00","caller":"storybook/storybook.go:104","msg":"Configuring storybook."}
open storybook-server/.storybook/preview.js: no such file or directory
exit status 1

should I install storybook manually?

templ info output
(✓) os [ goos=darwin goarch=amd64 ]
(✓) go [ location=/usr/local/opt/go/bin/go version=go version go1.23.2 darwin/amd64 ]
(✓) gopls [ location=/Users/adam/workspace/gowork/bin/gopls version=golang.org/x/tools/gopls v0.17.0 ]
(✓) templ [ location=/Users/adam/workspace/gowork/bin/templ version=v0.2.793 ]

@a-h
Copy link
Owner

a-h commented Dec 24, 2024

Looks like Storybook have messed with their installation process. As per the docs currently at https://www.npmjs.com/package/@storybook/server-webpack5 - you used to be able to run npx storybook@latest init -t server and it would create a package.json etc., but now that doesn't work, so I've had to create a default package.json and get that to work.

They've also changed the install process so that it automatically starts up a dev server, so I've added a --no-dev flag to the setup.

I've created a PR to fix it, if you've got time to test it out. Maybe it's time to properly document the Storybook support. IIRC, there was some discussion with Storybook about supporting server components, but it looks to have settled now.

@a-h
Copy link
Owner

a-h commented Dec 24, 2024

Oh also, to resolve your issue, if you try out the PR, you'll need to delete the storybook-server directory to get templ to rebuild it.

@a-h a-h added the bug Something isn't working label Dec 24, 2024
@a-h a-h closed this as completed in #1024 Dec 24, 2024
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
Development

Successfully merging a pull request may close this issue.

2 participants