fix(nuxt): do not warn about [[ optional dynamic params (#30619)

This commit is contained in:
Daniel Roe 2025-01-16 10:36:22 +00:00 committed by GitHub
parent f3e355a429
commit f277030e71
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -425,7 +425,9 @@ function parseSegment (segment: string, absolutePath: string) {
} else if (c && PARAM_CHAR_RE.test(c)) { } else if (c && PARAM_CHAR_RE.test(c)) {
buffer += c buffer += c
} else if (state === SegmentParserState.dynamic || state === SegmentParserState.optional) { } 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 break
} }