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 }