Comments (12)
there's indeed a bug in your reproduction, NuxtIsland
isn't able to mount properly with a <CLientOnly>
and a #fallback
from nuxt.
I got same problem with latest version 3.10.0.
from nuxt.
hmmm can you provide a minimal reproduction so i can check what's going on ?
from nuxt.
However if you really want to not block the ssr, you can wrap the server component with a
<ClientOnly>
Important to note: Then the content is also not in the initial HTML
from nuxt.
However if you really want to not block the ssr, you can wrap the server component with a
<ClientOnly>
Important to note: Then the content is also not in the initial HTML
βΊοΈ
I'm guessing this isn't really what I want then? I would need to wait until streaming support is available for Server Components? Surprised this hasn't already been added yet :P This is something that's pretty crucial over in the Next.js land atleast.
from nuxt.
I would need to wait until streaming support is available for Server Components?
I think so, yes.
from nuxt.
AFAIK there is no "streaming and replacing" supported at the time of writing, meaning all data (including the data from server components) need to be present to finish the initial request and to return the HTML.
from nuxt.
AFAIK there is no "streaming and replacing" supported at the time of writing, meaning all data (including the data from server components) need to be present to finish the initial request and to return the HTML.
I'm confused as to what the goal of the lazy
prop and fallback
slot is then? If the request blocks until data is loaded from the server component.. where does the lazy
and fallback
functionality come in to play? Also why does it work fine when i'm on another page, and redirect to the page (as shown in the video)?
from nuxt.
Hi π
@manniL is right. the lazy
prop act like useLazyAsyncData
and useLazyFetch
so it only works client side. However if you really want to not block the ssr, you can wrap the server component with a <ClientOnly>
from nuxt.
Hi π
@manniL is right. the
lazy
prop act likeuseLazyAsyncData
anduseLazyFetch
so it only works client side. However if you really want to not block the ssr, you can wrap the server component with a<ClientOnly>
@huang-julien as in:
<ClientOnly>
<TodoList :lazy="true">
<template #fallback>Loading...</template>
</TodoList>
</ClientOnly>
or...
<script setup lang="ts">
const { $client } = useNuxtApp()
const { data: todos } = $client.getTodos.useQuery()
</script>
<template>
<ClientOnly>
<li v-for="todo in todos" :key="todo.id">
{{ todo.name }}
</li>
</ClientOnly>
</template>
The first option seems to do what I want.. but it just stays "Loading..." and no data is actually loaded in the component... doesn't seem to render the component.
from nuxt.
Would you be able to provide a reproduction? π
More info
Why do I need to provide a reproduction?
Reproductions make it possible for us to triage and fix issues quickly with a relatively small team. It helps us discover the source of the problem, and also can reveal assumptions you or we might be making.
What will happen?
If you've provided a reproduction, we'll remove the label and try to reproduce the issue. If we can, we'll mark it as a bug and prioritize it based on its severity and how many people we think it might affect.
If needs reproduction
labeled issues don't receive any substantial activity (e.g., new comments featuring a reproduction link), we'll close them. That's not because we don't care! At any point, feel free to comment with a reproduction and we'll reopen it.
How can I create a reproduction?
We have a couple of templates for starting with a minimal reproduction:
π https://stackblitz.com/github/nuxt/starter/tree/v3-stackblitz
π https://codesandbox.io/s/github/nuxt/starter/v3-codesandbox
A public GitHub repository is also perfect. π
Please ensure that the reproduction is as minimal as possible. See more details in our guide.
You might also find these other articles interesting and/or helpful:
from nuxt.
hmmm can you provide a minimal reproduction so i can check what's going on ?
Here's a reproduction https://stackblitz.com/edit/github-cuqpvj?file=pages%2Findex.vue
I am new to Nuxt so if i'm just not doing something correctly, I apologize.
from nuxt.
Related Issues (20)
- Tailwindcss added at last is not applied HOT 5
- Disabling SSR prevents remaining CSS from loading HOT 5
- Error: Cannot find module punycode/ HOT 9
- Img @error not working HOT 2
- useHead undefined after initiating a regex (since monday) HOT 4
- keepalive not work HOT 1
- String vs object errors with `createError` and accessing server-thrown errors on client
- Tailwind css issue related to CSS specificity on dev server HOT 1
- keep alive caches are destroyed when visit keep alive excluded page HOT 3
- The package generated under the .output/server/node_modules file is a hyperlink. HOT 2
- 'text/html' is not a valid JavaScript MIME type. HOT 2
- This module cannot be imported in the Vue part of your app. [importing @nuxt/kit from app.vue] causing page to not work HOT 5
- If a component uses empty data in `useFetch`, then `clearError` will be invalidated HOT 2
- Cache control header missing in response headers (while using nitro.publicAssets) HOT 7
- [nuxt] [request error] [unhandled] [500] _fetch is not a function HOT 3
- feat: support passing options to `TypedRouterOptions` when using `experimental.typedPages` HOT 3
- Dynamic layouts HOT 4
- Previous route info HOT 2
- Imported CSS files not correctly injected in circumstances involving lazy-loaded components HOT 1
- Nuxt 3 Dev build time is very slow in WSL 2 Linux Ubuntu ~ ranging up to 30 seconds just to refresh changes HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nuxt.