Skip to content

Commit 723eea5

Browse files
fix: skip localized redirection on nuxt error routes (#3871)
Co-authored-by: ziyoonee <ziyoonee@users.noreply.github.com> Co-authored-by: Bobbie Goede <bobbiegoede@gmail.com>
1 parent c199361 commit 723eea5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/runtime/shared/matching.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ const getI18nPathToI18nPath = (path: string, locale: string) => {
1818

1919
export function isExistingNuxtRoute(path: string) {
2020
if (path === '') { return }
21+
// TODO: path should not have base url - check if base url is stripped earlier
22+
// skip nuxt error route - this path is hardcoded within nitro context code in nuxt
23+
if (path.endsWith('/__nuxt_error')) { return }
24+
2125
const resolvedMatch = matcher.resolve({ path }, { path: '/', name: '', matched: [], params: {}, meta: {} })
2226

2327
return resolvedMatch.matched.length > 0 ? resolvedMatch : undefined

0 commit comments

Comments
 (0)