Describe the bug
When running the WatchDocs target, if docsTool exits with a non-zero exit code due to an exception being thrown, the watcher fails to resume watching the file. After undoing the edit that caused the exception to be thrown, I expected my browser window to continue live reloading, but it didn't. I had to Ctrl+C the WatchDocs target and run it again in order to get live reload back in my browser window.
To Reproduce
Steps to reproduce the behavior:
Create a new project from the template
./build.sh WatchDocs
Edit docsSrc/index.md and add the following snippet:
let x = 5 + 7
Save and watch the code snippet update live in the browser
Now edit the code snippet to be:
let x = 5 + 7
printfn "%A" x
docsTool throws an exception:
Unhandled exception. System.Exception: error while formatting file /home/rmunn/path/to/project/docsSrc/index.md. Errors are:
seq
[SourceError
((0, 0),(0, 0),Error,
"The type 'TextWriter' is required here and is unavailable. You must add a reference to assembly 'System.Runtime.Extensions, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.")]
at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1637.Invoke(String message) in E:\A_work\130\s\src\fsharp\FSharp.Core\printf.fs:line 1637
at Program.GenerateDocs.format@266-2.Invoke(IEnumerable`1 arg20) in /home/rmunn/path/to/project/docsTool/Program.fs:line 266
... snip rest of exception for length ...
Edit the code snippet again to remove the printfn "%A" x line, and save the file
Browser doesn't refresh. Hitting Ctrl+R in the browser reveals that there is no longer a server serving HTTP on localhost:5000.
Editing a file in src/ProjectName/*.fs will cause the dotnet build watch to rebuild the project, but nothing seems to cause the docsTool watch to come back.
Expected behavior
I would expect the HTTP server serving up the local documentation files to stay up even if parsing fails. I would also expect the watch to keep watching the docsSrc/*.md files, so that once I delete the line that caused the exception and save the file, the watch would pick up on the save, re-parse the file (successfully), and refresh the browser tab again.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Describe the bug When running the WatchDocs target, if docsTool exits with a non-zero exit code due to an exception being thrown, the watcher fails to resume watching the file. After undoing the edit that caused the exception to be thrown, I expected my browser window to continue live reloading, but it didn't. I had to Ctrl+C the WatchDocs target and run it again in order to get live reload back in my browser window.
To Reproduce Steps to reproduce the behavior:
./build.sh WatchDocs
docsSrc/index.md
and add the following snippet:printfn "%A" x
line, and save the filesrc/ProjectName/*.fs
will cause thedotnet build
watch to rebuild the project, but nothing seems to cause the docsTool watch to come back.Expected behavior I would expect the HTTP server serving up the local documentation files to stay up even if parsing fails. I would also expect the watch to keep watching the
docsSrc/*.md
files, so that once I delete the line that caused the exception and save the file, the watch would pick up on the save, re-parse the file (successfully), and refresh the browser tab again.Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):