-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
plugin-client-redirects error should return non-zero code on build #7615
Comments
Indeed, we simply don't have a toggle for that. Maybe we should. |
👍 an option However we already have a "throw" level. That seems more appropriate if you want to make the build fail? We have other cases (broken links) where we can log errors and do not return a 1 exit code. To get a fail fast behavior you use "throw" and not "error". Do we want to change how we handle "error"? or "throw" matches your intent? |
On a tangent, "error" is a quite confusing config. We should just have "throw" (terminate) / "warn" (stderr) / "log" (stdout) / "ignore" |
Ah 😅 forgot about this one. So what a good config name could we have for that redirect plugin?
hmmm yes, should we kill "throw" or "error"? Maybe users are more used to "error" to terminate? 🤷♂️ |
Shall we just reuse it? The idea is basically the same here: trying to output duplicate files at the same location.
IMO killing "error" would be less trouble for the user, because "throw" is in the init template, and I doubt if anyone uses "error" in practice. (Unless they get confused.) |
Thanks guys! |
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
When an error in
plugin-client-redirects
occurs, it is only printed to std error whileyarn build
returns successfully:docusaurus/packages/docusaurus-plugin-client-redirects/src/collectRedirects.ts
Line 119 in fb3138d
This will cause CI not to fail in case of a duplicate route or other redirection errors.
Reproducible demo
No response
Steps to reproduce
plugin-client-redirects
pluginyarn build
0
which causes CI to succeed even if there are errors reported:onDuplicateRoutes: 'error'
doesn't help.Expected behavior
If the error is reported,
yarn build
should return a non-zero code. Ideally,onDuplicateRoutes
option should be considered, so if it is set towarning
or less strict,yarn build
still returns0
.Actual behavior
yarn build
returns0
even if errors are reported byplugin-client-redirects
.Your environment
Self-service
The text was updated successfully, but these errors were encountered: