statiqdev / Statiq.Framework

A flexible and extensible static content generation framework for .NET.
https://statiq.dev/framework
MIT License
425 stars 74 forks source link

A build pipeline is failing when using beta.23 #177

Closed AconCavy closed 3 years ago

AconCavy commented 3 years ago

An error is thrown in a build pipeline when using a package Statiq.Web 1.0.0-beta.23. The error does not throw in the previous version (beta.22).

To reproduce

  1. Create a console project named StatiqBlog.
  2. Import a package Statiq.Web 1.0.0-beta.23.
  3. Clone a theme of CleanBlog to StatiqBlog/theme.
  4. Create a Bootstrapper with Bootstrapper.Factory.CreateWeb(args).RunAsync();
  5. Create posts StatiqBlog/input/index.md and StatiqBlog/input/posts/hello.md.
  6. Run the project.
  7. Some errors are thrown in the build pipeline.

A part of the error log is below that replaced part of the path with (path).

[ERRO] Archives/PostProcess ≫ ExecuteSwitch ≫ RenderContentPostProcessTemplates ≫ ExecuteIf ≫ ExecuteIf ≫ RenderRazor ≫ [(path)/StatiqBlog/StatiqBlog/theme/input/posts.cshtml => posts.html] Value cannot be null. (Parameter 'key')
[ERRO] Archives/PostProcess ≫ ExecuteSwitch ≫ RenderContentPostProcessTemplates ≫ ExecuteIf ≫ ExecuteIf ≫ RenderRazor ≫ [(path)/StatiqBlog/StatiqBlog/theme/input/index.cshtml => index.html] Value cannot be null. (Parameter 'key')
[ERRO] Content/PostProcess ≫ RenderContentPostProcessTemplates ≫ ExecuteIf ≫ ExecuteIf ≫ ExecuteIf ≫ ExecuteConfig ≫ RenderRazor ≫ [(path)/StatiqBlog/StatiqBlog/input/posts/hello.md => posts/hello.html] Value cannot be null. (Parameter 'key')
[ERRO] Content/PostProcess ≫ RenderContentPostProcessTemplates ≫ ExecuteIf ≫ ExecuteIf ≫ ExecuteIf ≫ ExecuteConfig ≫ RenderRazor ≫ [(path)/StatiqBlog/StatiqBlog/input/index.md => index.html] Value cannot be null. (Parameter 'key')
daveaglick commented 3 years ago

Thanks for the report and detailed steps to reproduce! Hopefully this won't be a big deal to fix and I can get a patch out ASAP.

daveaglick commented 3 years ago

I can reproduce locally and have identified the problem - there was a regression in some link generation code that didn't get caught by unit tests. A fix (and more tests!) will be rolling out shortly.

daveaglick commented 3 years ago

Fix is now out on NuGet with new versions of Statiq Framework and Statiq Web - thanks again for catching this!