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

Opening redirected URL (through routeRules) does not redirect and breaks page #25743

Closed
manniL opened this issue Feb 11, 2024 · 7 comments
Closed

Comments

@manniL
Copy link
Member

manniL commented Feb 11, 2024

Environment


  • Operating System: Linux
  • Node Version: v18.18.0
  • Nuxt Version: 3.10.1
  • CLI Version: 3.10.0
  • Nitro Version: 2.8.1
  • Package Manager: [email protected]
  • Builder: -
  • User Config: devtools, routeRules
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/nuxt-issues-25743

  1. Click the link on the index page
  2. See error in the console and no content nor the redirect happening

[Vue warn]: Component is missing template or render function.

Describe the bug

When adding a redirect in the routeRules, e.g. routeRules: { '/support-me/': { redirect: { to: '/sponsors/', statusCode: 301 } } } and then trying to directly access the page through the browser, the redirect does not happen and the page breaks instead.

Additional context

Related PR: #25391

Logs

No response

Copy link

stackblitz bot commented Feb 11, 2024

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@danielroe
Copy link
Member

danielroe commented Feb 11, 2024

Weirdly, this works just fine when I download and run locally.

(Seems to be a trailing-slash issue, and reproducible with Nitro on its own - I don't think it's related to #25391.)

@danielroe
Copy link
Member

@danielroe
Copy link
Member

Let's track in unjs/nitro#2146.

@danielroe danielroe closed this as not planned Won't fix, can't repro, duplicate, stale Feb 11, 2024
@manniL
Copy link
Member Author

manniL commented Feb 12, 2024

@danielroe I think it was related to #25391 only because that adds all the redirects as static pages, prompting them to be generated via generate command. Could that be? 🤔

@danielroe
Copy link
Member

Ah - nice find. But it also seems to be reproducible in nitro on its own.

@danielroe
Copy link
Member

Also note #23813, which might be related (haven't investigated).

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

2 participants