Git Product home page Git Product logo

Comments (12)

huang-julien avatar huang-julien commented on July 1, 2024 2

there's indeed a bug in your reproduction, NuxtIsland isn't able to mount properly with a <CLientOnly> and a #fallback

from nuxt.

BoBo-Git avatar BoBo-Git commented on July 1, 2024 1

I got same problem with latest version 3.10.0.

from nuxt.

huang-julien avatar huang-julien commented on July 1, 2024 1

hmmm can you provide a minimal reproduction so i can check what's going on ?

from nuxt.

manniL avatar manniL commented on July 1, 2024 1

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.

dihmeetree avatar dihmeetree commented on July 1, 2024 1

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.

manniL avatar manniL commented on July 1, 2024 1

I would need to wait until streaming support is available for Server Components?

I think so, yes.

from nuxt.

manniL avatar manniL commented on July 1, 2024

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.

cc @huang-julien

from nuxt.

dihmeetree avatar dihmeetree commented on July 1, 2024

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.

cc @huang-julien

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.

huang-julien avatar huang-julien commented on July 1, 2024

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.

dihmeetree avatar dihmeetree commented on July 1, 2024

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>

@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.

github-actions avatar github-actions commented on July 1, 2024

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.

dihmeetree avatar dihmeetree commented on July 1, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.