Waypoint icon indicating copy to clipboard operation
Waypoint copied to clipboard

Unable to build the Content docs on MacOs

Open baronfel opened this issue 5 years ago • 1 comments

Describe the bug I can't run dotnet fornax build or dotnet fornax watch successfully in the docs folder of the Content template on MacOS.

To Reproduce

  1. Clone repo and cd to Content
  2. run dotnet tool restore
  3. run dotnet fake build to ensure library is built
  4. cd to docs
  5. run dotnet fornax build
  6. The build errors with something like
➜  docs git:(doubleslash) ✗ dotnet fornax watch
LOADER ERROR: Load Errors: [|/Users/chethusk/oss/Waypoint/Content/docs/loaders/literalloader.fsx (116,43)-(116,55) typecheck error The value, namespace, type or module 'PostCategory' is not defined. Maybe you want one of the following:
   Poster;
  /Users/chethusk/oss/Waypoint/Content/docs/loaders/literalloader.fsx (119,7)-(119,11) typecheck error The record label 'file' is not defined.;
  /Users/chethusk/oss/Waypoint/Content/docs/loaders/literalloader.fsx (139,26)-(139,44) typecheck error The record label 'disableLiveRefresh' is not defined.|]
Open Errors: [|input.fsx (1,6)-(1,19) typecheck error The namespace or module 'Literalloader' is not defined.|]
Get layout Errors: [|input.fsx (1,16)-(1,22) typecheck error The value or constructor 'loader' is not defined. Maybe you want one of the following:
   Loading
   Order|]
[14:01:33] multiple files generated in 113ms
[14:01:34] '/Users/chethusk/oss/Waypoint/Content/docs/_public/index.json' generated in 340ms
[14:01:34] '/Users/chethusk/oss/Waypoint/Content/docs/_public/explanations/some-post.html' generated in 422ms
[14:01:35] '/Users/chethusk/oss/Waypoint/Content/docs/_public/explanations/overview.html' generated in 684ms
[14:01:35] '/Users/chethusk/oss/Waypoint/Content/docs/_public/tutorials/some-post.html' generated in 504ms
[14:01:36] '/Users/chethusk/oss/Waypoint/Content/docs/_public/tutorials/how-to-start.html' generated in 419ms
[14:01:36] '/Users/chethusk/oss/Waypoint/Content/docs/_public/how-tos/somePostWithCode.html' generated in 421ms
[14:01:37] '/Users/chethusk/oss/Waypoint/Content/docs/_public/how-tos/diagrams.html' generated in 390ms
An unexpected error happend: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.Collections.Generic.KeyNotFoundException: An index satisfying the predicate was not found in the collection.
   at Microsoft.FSharp.Collections.SeqModule.Find[T](FSharpFunc`2 predicate, IEnumerable`1 source) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 677
   at FSI_0046.Page.generate'(SiteContents ctx, String page)
   at lambda_method(Closure , Unit , SiteContents , String , String )
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Generator.EvaluatorHelpers.helper@54(Object next, FSharpList`1 args) in D:\Programowanie\Projekty\Ionide\Fornax\src\Fornax\Generator.fs:line 64
   at Generator.EvaluatorHelpers.invokeFunction(Object f, IEnumerable`1 args) in D:\Programowanie\Projekty\Ionide\Fornax\src\Fornax\Generator.fs:line 68
   at [email protected](FsiValue ft) in D:\Programowanie\Projekty\Ionide\Fornax\src\Fornax\Generator.fs:line 178
   at Microsoft.FSharp.Core.ResultModule.Bind[T,TResult,TError](FSharpFunc`2 binder, FSharpResult`2 result) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\result.fs:line 15
   at Generator.GeneratorEvaluator.evaluate(FsiEvaluationSession fsi, SiteContents siteContent, String generatorPath, String projectRoot, String page) in D:\Programowanie\Projekty\Ionide\Fornax\src\Fornax\Generator.fs:line 175
   at Generator.generate(FsiEvaluationSession fsi, Config cfg, SiteContents siteContent, String projectRoot, String page) in D:\Programowanie\Projekty\Ionide\Fornax\src\Fornax\Generator.fs:line 321
   at Generator.action@1(String projectRoot, FsiEvaluationSession fsi, Config config, SiteContents sc, String filePath) in D:\Programowanie\Projekty\Ionide\Fornax\src\Fornax\Generator.fs:line 479
   at Generator.generateFolder(String projectRoot, Boolean isWatch) in D:\Programowanie\Projekty\Ionide\Fornax\src\Fornax\Generator.fs:line 478
   at Fornax.guardedGenerate@168(String cwd, Unit unitVar0) in D:\Programowanie\Projekty\Ionide\Fornax\src\Fornax\Fornax.fs:line 170

I think the problem here is that the literal loader can't typecheck correctly, which causes a fault in the page generator later on.

Expected behaviour The api, content, and search docs are all build.

Environment (please complete the following information):

  • OS: macos catalina
  • dotnet SDK version: 3.1.300

baronfel avatar Jun 11 '20 19:06 baronfel

Hi!

Had the same error :(

I could generate the docs after a few changes...

In https://github.com/ionide/Waypoint/blob/master/Content/docs/loaders/literalloader.fsx

I commented the #if preprocesor

So instead of

#if !FORNAX
#load "./contentloader.fsx"
open Contentloader
#endif

Now I have

// #if !FORNAX
#load "./contentloader.fsx"
open Contentloader
// #endif

Then I noticed that the build directory didn't generate after dotnet fake build and so I looked the build.fsx and I ran dotnet fake build target BuildRelease

Then there was another exception and it was about a Generator and I removed this file

https://github.com/ionide/Waypoint/blob/master/Content/docs/content/how-tos/script.fsx

And now the docs are generated :)

jjchiw avatar Sep 17 '20 21:09 jjchiw