diff --git a/packages/nuxt/src/pages/utils.ts b/packages/nuxt/src/pages/utils.ts index 2b278747bb..7f52fa09ca 100644 --- a/packages/nuxt/src/pages/utils.ts +++ b/packages/nuxt/src/pages/utils.ts @@ -424,7 +424,7 @@ function parseSegment (segment: string, absolutePath: string) { state = SegmentParserState.initial } else if (c && PARAM_CHAR_RE.test(c)) { buffer += c - } else { + } 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}\`.`) } break