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

Fix: Extend the server proxy preset to also fetch SSG NuxtIslands #815

Merged

Conversation

brandondv
Copy link
Contributor

📚 Description

This PR extends the preset for the server proxy, to also allow the fetching of NuxtIsland components from the dev server.

Standalone stories for NuxtIslands work fine. But when you have a component that has a NuxtIsland component in it, it won't render (properly) because it can't find the server only parts in the Storybook server. With this PR those routes are exposed and make the stories render.

There's one thing left to make NuxtIsland's work without any user changes needed: a Suspense wrapper, but I wasn't too sure if/where that should be enabled by default.

Reproduction stories

main...brandondv:nuxtjs-storybook:feature/child-nuxt-island-stories

Copy link

netlify bot commented Nov 26, 2024

👷 Deploy request for nuxt-storybook pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit ea58df3

@tobiasdiez
Copy link
Collaborator

Thanks for the PR!

Could you please shortly explain how this nuxt proxy works? I was never able to really unravel why it is needed in the first place.

Could you also please add a story that uses an island in the showcase example, or is this too hard?

@chakAs3
Copy link
Collaborator

chakAs3 commented Nov 27, 2024

Could you please shortly explain how this nuxt proxy works? I was never able to really unravel why it is needed in the first place.

I used the proxy to serve files from the Nuxt dev server (port 3000) since Storybook runs on a separate dev server. This setup allowed components like NuxtImage and page routing to function properly. However, I wonder if there’s a better approach to consolidate everything into a single dev server.

@chakAs3 chakAs3 merged commit 83ab4a1 into nuxt-modules:main Nov 28, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants