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

Error Failed to execute 'insertBefore' on 'Node' with navigateTo in page #13656

Closed
atinux opened this issue Apr 6, 2022 · 2 comments
Closed

Comments

@atinux
Copy link
Member

atinux commented Apr 6, 2022

Environment


  • Operating System: Linux
  • Node Version: v16.14.2
  • Nuxt Version: 3.0.0-27487836.540e23c
  • Package Manager: npm@7.17.0
  • Builder: vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/nuxt-starter-rhwgzj?file=pages%2Fnavigate-to.vue

Describe the bug

  • Open the preview in a new window
  • Click on navigateTo('/secret') link
  • Page is blank and an error is displayed in the console

See video:

Screenshot.2022-04-06.at.20.55.40.mp4

Additional context

The error happens also if navigateTo is not inside an useAsyncData, same as if we use router.push.

I believe this might be an issue related to <Suspense>?

Logs

No response

@pi0
Copy link
Member

pi0 commented Apr 6, 2022

You should't make any side-effect from useAsyncData's fetcher and also await on navigateTo. This seems working fine for me without hydration.

<script setup>
await navigateTo('/secret');
</script> 

@atinux
Copy link
Member Author

atinux commented Apr 6, 2022

Agree for side-effects but this can be related to asyncData in Nuxt 2 where we offered redirect and error inside of it (even though implementation is different).

Thanks for the fast answer ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants