question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Quick blank page appear when navigating to a different layout in a page using useFetch

See original GitHub issue

Environment

Nuxt CLI v3.0.0-rc.6 00:26:03 Nuxt project info: 00:26:05


  • Operating System: Darwin
  • Node Version: v18.6.0
  • Nuxt Version: 3.0.0-rc.6
  • Package Manager: npm@8.13.2
  • Builder: vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

This bug is not visible on Sandboxes, because all pages navigation are already displaying quick blank page. Try to clone the reproduction on your computer 😅 https://codesandbox.io/s/shy-https-f2u380?file=/pages/pages/index.vue

Describe the bug

When navigating on pages that contains a layout, which also contains a layout, the page display an entire blank page for a quick time. As you can see on the reproduction link, all my index.vue pages are using a main layout, who uses the default layout.
Try to navigate from /pages/other to /pages/ or / by using links present on pages, and you’ll normally see the white page for a few time.

Maybe this issue is not only related to layouts, but on my main website, I’ve got this blank page only on navigating on / route, which is the only one implementing nested layouts.

Additional context

I’ve checked #4624, but unfortunately, my / page contains a single root element.
After more investigation, it’s possible that this issue occurs when setting definePageMeta({ layout: false }); and use MyNestedLayout instead as a wrapper component, to allow usage of multiple (named) slots in layout

Logs

No response

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mlbonnieccommented, Aug 2, 2022

You’re right, I’m able to use multiple slots, sorry for that ^^ However, I still have blank flash 😬
@procrates could you try the solution that proposed Daniel and keep us informed if it solved the issue for you ?

Here’s how I setup layouts ./src/pages/index.vue

<div align="center"> Main Page </div>

./src/layouts/main.vue

<div align="center"> Capture d’écran 2022-08-02 à 14 11 58 </div>
1reaction
procratescommented, Aug 2, 2022

It is not only you. I am using nested layouts explicitly to display dynamic content on the layout based on the page. Only way to do that is to wrap the page in <NuxtLayout name="layout"> with <template> tags.

This causes the a momentarily blank screen when navigating. It dosnt feel right since it is supposed to be a PWA.

Thanks for figuring this out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Blank page in react after using navigation - Stack Overflow
You can nest your button inside a link to navigate to a different page. App.js:
Read more >
Server-Side Rendering with Nuxt.js Application - Medium
the first step to display your custom error page is to create a new file error.vue in layouts directory. This page receives prop...
Read more >
Suspense for Data Fetching (Experimental) - React
This page focuses on the data fetching use case, but it can also wait for images ... Over the next several months, many...
Read more >
Suppress blank page in asymmetrical multicolumn layout - TeX
The \column command no longer appears to respect the column widths and the text bunches up at the bottom of the first column....
Read more >
The last guide to the useEffect Hook you'll ever need
With useEffect , you invoke side effects from within functional components, which is an important concept to understand in the React Hooks era....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found