Have you read the Contributing Guidelines on issues?
Prerequisites
Description
Based on the PR 9171 (issue #6845) This should be solved but isn't in Docusaurus v3.7.0 ("@docusaurus/plugin-client-redirects": "^3.7.0")
Stacktrace:
[ERROR] [Error [ValidationError]: "redirects[0].from" (/Load-Management/DLM/#hierarchial-dlm) is not a valid pathname. Pathname should start with slash and not contain any domain or query string.] {
_original: {
fromExtensions: [ 'html', 'htm' ],
redirects: [
{
from: '/Load-Management/DLM/#hierarchial-dlm',
to: '/Load-Management/DLM/dlm-hierarchical'
},
{
from: '/Load-Management/DLM/#solar-dlm',
to: '/Load-Management/DLM/dlm-solar'
}
]
},
details: [
{
message: '"redirects[0].from" (/Load-Management/DLM/#hierarchial-dlm) is not a valid pathname. Pathname should start with slash and not contain any domain or query string.',
path: [ 'redirects', 0, 'from' ],
type: 'any.custom',
context: {
error: Error
at C:\WS-Bender\PRODUCT-DOCS\node_modules\@docusaurus\utils-validation\lib\validationSchemas.js:66:15
at Object.validate (C:\WS-Bender\PRODUCT-DOCS\node_modules\joi\lib\types\any.js:47:28)
at internals.rules (C:\WS-Bender\PRODUCT-DOCS\node_modules\joi\lib\validator.js:494:33)
at exports.validate (C:\WS-Bender\PRODUCT-DOCS\node_modules\joi\lib\validator.js:450:22)
at internals.Base.$_validate (C:\WS-Bender\PRODUCT-DOCS\node_modules\joi\lib\base.js:774:26)
at Object.validate (C:\WS-Bender\PRODUCT-DOCS\node_modules\joi\lib\types\alternatives.js:115:44)
at exports.validate (C:\WS-Bender\PRODUCT-DOCS\node_modules\joi\lib\validator.js:425:26)
at internals.Base.$_validate (C:\WS-Bender\PRODUCT-DOCS\node_modules\joi\lib\base.js:774:26)
at Object.validate (C:\WS-Bender\PRODUCT-DOCS\node_modules\joi\lib\types\keys.js:108:45)
at exports.validate (C:\WS-Bender\PRODUCT-DOCS\node_modules\joi\lib\validator.js:425:26),
label: 'redirects[0].from',
value: '/Load-Management/DLM/#hierarchial-dlm',
key: 'from'
}
}
]
}
[INFO] Docusaurus version: 3.7.0
Node version: v21.5.0
error Command failed with exit code 1.
Reproducible demo
No response
Steps to reproduce
set redirects that have a hash fragment, e.g.,
/**
* Docusaurus redirect rules for @docusaurus/plugin-client-redirects
* Format: { from: string | string[], to: string }
*/
module.exports = [
{
from: '/Load-Management/DLM/#hierarchial-dlm',
to: '/Load-Management/DLM/dlm-hierarchical',
},
{
from: '/Load-Management/DLM/#solar-dlm',
to: '/Load-Management/DLM/dlm-solar',
},
];
Expected behavior
Working redirects.
Actual behavior
Validation error.
Your environment
- Docusaurus version used: 3.7.0
Self-service
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clearoryarn clearcommand.rm -rf node_modules yarn.lock package-lock.jsonand re-installing packages.Description
Based on the PR 9171 (issue #6845) This should be solved but isn't in Docusaurus v3.7.0 (
"@docusaurus/plugin-client-redirects": "^3.7.0")Stacktrace:
Reproducible demo
No response
Steps to reproduce
set redirects that have a hash fragment, e.g.,
Expected behavior
Working redirects.
Actual behavior
Validation error.
Your environment
Self-service