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

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

Merged
pi0 merged 3 commits intonuxt: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 intonuxt:mainfrom
huang-julien:fix/navigateTo

Conversation

@huang-julien
Copy link
Copy Markdown
Member

🔗 Linked issue

resolve nuxt/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
Copy link
Copy Markdown

netlify Bot commented Sep 17, 2022

Deploy Preview for nuxt3-docs canceled.

Name Link
🔨 Latest commit d9a89d8
🔍 Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/63282b0b0eb1dd00082a9f5d

Copy link
Copy Markdown
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

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

Nice find!

Comment thread test/basic.test.ts Outdated
@pi0 pi0 merged commit c4fe852 into nuxt:main Sep 19, 2022
@pi0
Copy link
Copy Markdown
Member

pi0 commented Sep 19, 2022

Thanks!

@pi0 pi0 mentioned this pull request Sep 20, 2022
@danielroe danielroe added the 3.x label Jan 19, 2023
Sign up for free to 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