Skip to content

Unable to build the Content docs on MacOs #29

@baronfel

Description

@baronfel

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions