未验证 提交 b42be175 编写于 作者: J JJ Kasper 提交者: GitHub

Normalize optional catch-all fallback: true page params (#17551)

This makes sure to normalize the params for optional catch-all routes on Vercel since for `fallback: true` pages the `[[...paramName]]` value will be provided for the undefined/root param which needs to be normalized. 

Tests have been added in https://github.com/vercel/vercel/pull/5247 and were manually tested with the changes in this PR with https://github.com/ijjk/next-update-loader

Fixes: https://github.com/vercel/next.js/issues/17220
x-ref: https://github.com/vercel/vercel/pull/5247
上级 782b7e48
......@@ -89,7 +89,12 @@ const nextServerlessLoader: loader.Loader = function () {
(!value || (
Array.isArray(value) &&
value.length === 1 &&
value[0] === 'index'
${
''
// fallback optional catch-all SSG pages have
// [[...paramName]] for the root path on Vercel
}
(value[0] === 'index' || value[0] === \`[[...\${key}]]\`)
))
) {
value = undefined
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册