Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.
/frameworkPublic archive

fix(nuxt): add missing process.client for early redirect in navigateTo - #7625

Merged
pi0 merged 3 commits into
nuxt:mainfrom
huang-julien:fix/navigateTo
Sep 19, 2022
Merged

fix(nuxt): add missing process.client for early redirect in navigateTo#7625
pi0 merged 3 commits into
nuxt:mainfrom
huang-julien:fix/navigateTo

Conversation

@huang-julien

Copy link
Copy Markdown
Member

🔗 Linked issue

resolvenuxt/nuxt#14890

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Hi 👋 , this PR is a small fix adding process.client to early redirect on client side for navigateTo(). There's also a small test to ensure the http status code is correct.

However there's an issue using navigateTo in async middlewares which throws a nuxt instance not available error. I believe this has been already reported in some issues.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@netlify

netlifyBot commented Sep 17, 2022

Copy link
Copy Markdown

Deploy Preview for nuxt3-docs canceled.

NameLink
🔨 Latest commitd9a89d8
🔍 Latest deploy loghttps://app.netlify.com/sites/nuxt3-docs/deploys/63282b0b0eb1dd00082a9f5d

pi0
pi0 approved these changes Sep 19, 2022

@pi0pi0 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find!

Comment threadtest/basic.test.ts Outdated
@pi0
pi0 merged commit c4fe852 into nuxt:mainSep 19, 2022
@pi0

pi0 commented Sep 19, 2022

Copy link
Copy Markdown
Member

Thanks!

@pi0pi0 mentioned this pull request Sep 20, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

navigateTo in middleware loses options on server side

3 participants

@huang-julien@pi0@danielroe