Have you read the Contributing Guidelines on issues?
Prerequisites
Description
For paths to folders without a trailing slash, hosts will typically 302 redirect to the path with the slash
e.g. https://docs.sheetjs.com/docs/getting-started redirects to https://docs.sheetjs.com/docs/getting-started/
@docusaurus/plugin-client-redirects does not seem to be aware of this behavior for folders that have subfolders.
This redirect works
{ from: '/docs/installation', to: '/docs/getting-started/' }, // works
This redirect elicits the error mentioned in the title:
{ from: '/docs/installation', to: '/docs/getting-started' }, // elicits error
The fact that it works for leaf folders that only have index.html suggests this is a bug in the redirect scanner:
{ from: '/docs/example', to: '/docs/getting-started/example' }, // this works, even though `example` is a folder
Reproducible demo
https://github.com/SheetJS/docs.sheetjs.com
Steps to reproduce
git clone --depth=1 https://github.com/SheetJS/docs.sheetjs.com
cd docs.sheetjs.com/docz
npm i
npm run build ## note: this should work
sed -I '' "s#started/'#started'#g" docusaurus.config.js
npm run build ## this will fail with the aforementioned error
If the sed command fails, the edit is in docusaurus.config.js:
redirects: [
{ from: '/docs/example', to: '/docs/getting-started/example' },
- { from: '/docs/installation', to: '/docs/getting-started/' },
+ { from: '/docs/installation', to: '/docs/getting-started' },
]
}]
Expected behavior
It should create the redirect
Actual behavior
[ERROR] Error: You are trying to create client-side redirections to paths that do not exist:
The path in question is not listed in the valid paths
Your environment
No response
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
For paths to folders without a trailing slash, hosts will typically 302 redirect to the path with the slash
e.g. https://docs.sheetjs.com/docs/getting-started redirects to https://docs.sheetjs.com/docs/getting-started/
@docusaurus/plugin-client-redirectsdoes not seem to be aware of this behavior for folders that have subfolders.This redirect works
This redirect elicits the error mentioned in the title:
The fact that it works for leaf folders that only have
index.htmlsuggests this is a bug in the redirect scanner:Reproducible demo
https://github.com/SheetJS/docs.sheetjs.com
Steps to reproduce
If the
sedcommand fails, the edit is indocusaurus.config.js:redirects: [ { from: '/docs/example', to: '/docs/getting-started/example' }, - { from: '/docs/installation', to: '/docs/getting-started/' }, + { from: '/docs/installation', to: '/docs/getting-started' }, ] }]Expected behavior
It should create the redirect
Actual behavior
The path in question is not listed in the valid paths
Your environment
No response
Self-service