From f277030e713b483750ffa7661f78334dee9dc969 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Thu, 16 Jan 2025 10:36:22 +0000 Subject: [PATCH] fix(nuxt): do not warn about `[[` optional dynamic params (#30619) --- packages/nuxt/src/pages/utils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/nuxt/src/pages/utils.ts b/packages/nuxt/src/pages/utils.ts index 7f52fa09ca..5d8c6777ed 100644 --- a/packages/nuxt/src/pages/utils.ts +++ b/packages/nuxt/src/pages/utils.ts @@ -425,7 +425,9 @@ function parseSegment (segment: string, absolutePath: string) { } else if (c && PARAM_CHAR_RE.test(c)) { buffer += c } else if (state === SegmentParserState.dynamic || state === SegmentParserState.optional) { - logger.warn(`'\`${c}\`' is not allowed in a dynamic route parameter and has been ignored. Consider renaming \`${absolutePath}\`.`) + if (c !== '[' && c !== ']') { + logger.warn(`'\`${c}\`' is not allowed in a dynamic route parameter and has been ignored. Consider renaming \`${absolutePath}\`.`) + } } break }