8000 fix(nuxt): provide fallback route by danielroe Β· Pull Request #22580 Β· nuxt/nuxt Β· GitHub
[go: up one dir, main page]

Skip to content

fix(nuxt): provide fallback route #22580

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

Merged
merged 2 commits into from
Aug 10, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(nuxt): provide fallback route
  • Loading branch information
danielroe committed Aug 10, 2023
commit 7c4f4ca912e8d8e1a746ef35517d784d863be063
2 changes: 1 addition & 1 deletion packages/nuxt/src/pages/route-injection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const RouteInjectionPlugin = (nuxt: Nuxt) => createUnplugin(() => {
const s = new MagicString(code)
s.replace(INJECTION_RE, () => {
replaced = true
return '_ctx._.provides[__nuxt_route_symbol]'
return '(_ctx._.provides[__nuxt_route_symbol] || _ctx.$route)'
})
if (replaced) {
s.prepend('import { PageRouteSymbol as __nuxt_route_symbol } from \'#app/components/injections\';\n')
Expand Down
0