fix(nuxt): do not warn about invalid characters in route groups/catchalls

This commit is contained in:
Daniel Roe 2025-01-14 13:12:59 +00:00
parent 06d5840d26
commit 5be18cf4b0
No known key found for this signature in database
GPG Key ID: 3714AB03996F442B

View File

@ -424,7 +424,7 @@ function parseSegment (segment: string, absolutePath: string) {
state = SegmentParserState.initial state = SegmentParserState.initial
} else if (c && PARAM_CHAR_RE.test(c)) { } else if (c && PARAM_CHAR_RE.test(c)) {
buffer += 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}\`.`) logger.warn(`'\`${c}\`' is not allowed in a dynamic route parameter and has been ignored. Consider renaming \`${absolutePath}\`.`)
} }
break break