cue
cue copied to clipboard
alpha.cuelang.org: a page with errors is never "seen" in serve mode
What page were you looking at?
https://alpha.cuelang.org/
What version of the site were you looking at?
https://github.com/cue-lang/cuelang.org/commit/eb2ecd699e4451e0284f62764d145abdd14040e2
What did you do?
- Modified
content/docs/tutorial/working-with-a-custom-module-registry/en.mdto have an error, by duplicating thecue versionblock (which means the block name is used twice) - Ran
./_scripts/serve.bash - Observed the error in the output:
** /home/myitcv/dev/cuelang/cuelang.org/content/docs/tutorial/working-with-a-custom-module-registry/en.md: node type "script" declares label "cue version" multiple times:
/home/myitcv/dev/cuelang/cuelang.org/content/docs/tutorial/working-with-a-custom-module-registry/en.md:55:8
/home/myitcv/dev/cuelang/cuelang.org/content/docs/tutorial/working-with-a-custom-module-registry/en.md:60:8
- Fixed the error by deleting the duplicate block.
- Saved the filed.
What did you expect?
The "watch" in serve mode to see the file, and re-run the preprocessor for that page because the inputs have changed.
What did you see instead?
The preprocessor does not. So I cannot recover from this error situation.
The same situation happens when an error is introduced. The preprocessor for some reason appears to "drop" the watch on the page.
Merging https://review.gerrithub.io/c/cue-lang/cuelang.org/+/1176998 only solved half the problem - the preprocessor. Hugo still can't recover after a failure processing its directives.
Steps to reproduce:
- run
_scripts/serve.bashat a known-good site state - break hugo with an incorrect directive. e.g. Add
{{< infoto any page - observe the Hugo error page served at http://localhost:1313
- unbreak the page and observe the preprocessor write the now-correct page into the
hugohierarchy - refresh http://localhost:1313
- observe the Hugo error page still being served
I'm not sure if this is an actual Hugo problem, or if the way we're dropping the "fixed" files into the hugo directory isn't triggering a full re-examination of the (now fixed) error state; or something else.
I've captured the hugo problem in https://github.com/cue-lang/cue/issues/3109