statiqdev / Statiq.Web

Statiq Web is a flexible static site generator written in .NET.
https://statiq.dev/web
Other
1.64k stars 235 forks source link

Errors upgrading from Alpha to Beta #916

Closed igor-pikovsky closed 3 years ago

igor-pikovsky commented 3 years ago

Having update Nuget from Alpha to Beta, I suddenly encounter the following error

[ERRO] Content/PostProcess » RenderPostProcessTemplates » ExecuteIf » Error while executing module RenderRazor in Content/PostProcess: Sequence contains no elements

I don't see how I can debug this, as placing breakpoints in cshtml files makes no difference

igor-pikovsky commented 3 years ago

I traced this down to the fact that Outputs["Data"] is empty. My inpuit/Data folder contains 7 json files. Previously in cshtml document I could access input/Data/myfile.json by

IDocument pageData = Outputs["Data"].FilterSources("Data/myfile.json").Single();

Now Outputs["Data"] is always empty.

I see the following output:

[INFO]    Data/Process » Finished Data Process phase execution (7 output document(s), 106 ms)
...
[INFO] -> Data/Output » Starting Data Output phase execution... (7 input document(s), 2 module(s))
...
[INFO]    Data/Output » Finished Data Output phase execution (0 output document(s), 8 ms)

As you see, I have 7 documents to start with in the Data folder, but none of them made it to the output.

I have attempted adding _Directory.json containing "ShouldOutput ": true , but that made no difference.

Any suggestions?

daveaglick commented 3 years ago

Yeah, there was a recent breaking change related to the Outputs collection. Whereas before the indexer returned documents from a particular pipeline, it now does an aggregate globbing search over all pipelines.

I'm trying to keep breaking changes to an absolute minimum, but as we get really close to a 1.0 release there may still be a couple breaks like this one where, based on feedback, the break is worth it to make the final system clearer (in this case, figuring out which pipelines to find which documents in was really confusing folks).

The release notes had details on this one - I'd continue monitoring those for the next couple releases just in case I have to make one or two more breaks like this. To get you back up and running you can call Outputs.FromPipeline("Data") and that will give you equivalent behavior to the old call.

igor-pikovsky commented 3 years ago

Thank you very much – it’s up and running again.

From: Dave Glick notifications@github.com Sent: 12 August 2020 17:34 To: statiqdev/Statiq.Web Statiq.Web@noreply.github.com Cc: igor-pikovsky igor.pikovsky@outlook.com; Author author@noreply.github.com Subject: Re: [statiqdev/Statiq.Web] Errors upgrading from Alpha to Beta (#916)

Yeah, there was a recent breaking change related to the Outputs collection. Whereas before the indexer returned documents from a particular pipeline, it now does an aggregate globbing search over all pipelines.

I'm trying to keep breaking changes to an absolute minimum, but as we get really close to a 1.0 release there may still be a couple breaks like this one where, based on feedback, the break is worth it to make the final system clearer (in this case, figuring out which pipelines to find which documents in was really confusing folks).

The release notes had details on this one - I'd continue monitoring those for the next couple releases just in case I have to make one or two more breaks like this. To get you back up and running you can call Outputs.FromPipeline("Data") and that will give you equivalent behavior to the old call.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://eur05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fstatiqdev%2FStatiq.Web%2Fissues%2F916%23issuecomment-672981683&data=02%7C01%7C%7C2ec62cc326814db5ee3d08d83edd7334%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637328468116713418&sdata=rrhs1YQo1K63YxyLvySElSvXAUHCxp1KUf9Tz6mcdQA%3D&reserved=0, or unsubscribehttps://eur05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAO354FSBCCWMA75MPIVOTXTSAK75VANCNFSM4P3KEDJA&data=02%7C01%7C%7C2ec62cc326814db5ee3d08d83edd7334%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637328468116723411&sdata=LSDG6O8OiV%2BscLrR1JxsPZrnb5CmI158gqDV5nC61ko%3D&reserved=0.

daveaglick commented 3 years ago

Great! Don't hesitate to ask if you run into any more upgrading problems - I'm happy to help everyone through these final versions leading up to release.