-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[🐞] server$ doesn't work in Storybook integration #4781
Comments
@literalpie I'm not sure if this is related to the storybook or not, But I mentioned you since you have more details. |
Oh yes, this is probably more of an issue for the storybook-framework-Qwik package (or storybook itself) than Qwik core. I don't think I ever tested server functions, and all the storybook stuff is browser-based so I don't know what we can do about this without deeper changes to storybook 😬 |
@manucorporat Since this issue blocked me now, regarding the situation of returning data, do you have any suggestion? |
Another way is we can change the way of using Storybook. In my team, we made a decision that Storybook should be only for reusable components without touching deep framework apis. For example, routing apis should be excluded. Our reusable components reflect the design system and design system doesn’t know about framework. By putting a separation like that, it will make Storybook lighter to build, serve and also we have a separation between design system vs app domain contexts. I hope this experience helps you something :) Bonus: I also included a tip how to improve Storybook build time https://discord.com/channels/842438759945601056/1127905633849585704 |
@ahnpnl It makes sense. But in my case, some of the information is handled only by the node server which can be polyfilled but I don't want to do it. Since this problem is only happening in Storybook integration, probably there are some configurations that are ignoring the default |
Can we extract the logic of using |
@ahnpnl It is acceptable but at this point, the consistency of workflow is not the same as production. Component and the app domain context are not related together and the component is using our general domain logics. But since the logic is only available in server, there are two options. Transfering server logic to out of component and pass through props, or using mock. Btw, in both ways, since we are using Storybook for both documentation and previews, it has to be implemented completely same as production. The problem here is not about separation of concern. It's about the process of |
I would like to address this issue. can you add the steps to reproduce the error pls? |
Hello @saeedhbi. Please provide the missing information requested above. |
Which component is affected?
Qwik City (routing)
Describe the bug
I'm working on a mono repo project which is using Qwik. The problem I have is when I'm integrating with Storybook, the
server$
functions don't work and the returned data isundefined
. This is not happening on tests.I have tested with both manual and https://github.com/literalpie/storybook-framework-qwik integrations, and both are the same.
FYI, the main app is simple and just uses a component from a library component which is added to
vendorRoots
ofqwikVite
plugin option. (I'm pretty sure there is no problem regarding configuration). JSX handling is handling completely but when I'm adding the target logic into theserver$
, it's not working, but without it, there is no problem.My question is, in what situation,
server$
can not be handled and is undefined? And, since the storybook is running indev
environment, how can I see server logs to determine what is processed?Reproduction
//
Steps to reproduce
No response
System Info
Additional Information
Unfortunately, I couldn't create a production URL for this.
The text was updated successfully, but these errors were encountered: