-
Notifications
You must be signed in to change notification settings - Fork 920
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NPE for $parent.File.UniqueID
using Hugo 0.123.1.
#1874
Comments
From #1863 (comment), @chulcher adds:
|
@chulcher @deining - I can't reproduce the error using the instructions I gave in #1866 (comment), so maybe your setup is slightly different? |
I only see the error when
That's what I've currently configured to get the site to render as only |
Can confirm this is still there with Hugo 0.123.8 -- I'm just playing catchup since I did an update on local build and started seeing this issue. |
During rendering the section index of a docs list it could happen that a file has no parent for e.g. the homepage. If such scenario is existing the .Parent.File of a file is nil. Therefore this case should be handled within the rendering itself. Fixes google#1874 Signed-off-by: Tobias Kohlbau <[email protected]>
I've indentified the root cause. It's caused by for e.g. a homepage to exist, this results in .Parent.File within the $pages list to be empty. The pages containing no file within the parent should be filtered out as well. I've created #1890 to address this. For anyone curious to test this, add the following to your go.mod file:
by for eg. executing:
Please let me know if this fixes the issue for you too. On my project it works after applying #1890. |
I think I'm still having this same problem. Current output from a fairly basic site importing the main docsy (though I get the same error on our ouhft fork):
I've removed the contents of the Hugo cache (several times) and the same behaviour repeats. I can see that the edit proposed by @tobiaskohlbau has been included on
I've just been testing this with Hugo 0.124.1, and am presently stumped as to what to try next (apart from trying to revert back to Hugo 0.122.x). Any further suggestions for things I could test please? |
I've had a go at reproducing a minimal test site that generates this issue for me - it's at https://github.com/ouhft/docsy-debug-1874 - essentially it confirms what @chulcher pointed out earlier. I've outlined each step I've taken in the README.md. Short version, the use of the Edit 2: I've just tested a larger site with explicitly putting the Also, I've tested So, the explicit test seems to be for the use of HTH |
Did you use replace statements in order to try my current fork? I've learned that Hugo does not use replace statements with versions only local ones. This means the repository has to be checked out locally and replaced with a relative path. |
During rendering the section index of a docs list it could happen that a file has no parent for e.g. the homepage. If such scenario is existing the .Parent.File of a file is nil. Therefore this case should be handled within the rendering itself. Fixes google#1874 Signed-off-by: Tobias Kohlbau <[email protected]>
During rendering the section index of a docs list it could happen that a file has no parent for e.g. the homepage. If such scenario is existing the .Parent.File of a file is nil. Therefore this case should be handled within the rendering itself. Fixes google#1874 Signed-off-by: Tobias Kohlbau <[email protected]>
During rendering the section index of a docs list it could happen that a file has no parent for e.g. the homepage. If such scenario is existing the .Parent.File of a file is nil. Therefore this case should be handled within the rendering itself. Fixes google#1874 Signed-off-by: Tobias Kohlbau <[email protected]>
During rendering the section index of a docs list it could happen that a file has no parent for e.g. the homepage. If such scenario is existing the .Parent.File of a file is nil. Therefore this case should be handled within the rendering itself. Fixes google#1874 Signed-off-by: Tobias Kohlbau <[email protected]>
During rendering the section index of a docs list it could happen that a file has no parent for e.g. the homepage. If such scenario is existing the .Parent.File of a file is nil. Therefore this case should be handled within the rendering itself. Fixes google#1874 Signed-off-by: Tobias Kohlbau <[email protected]>
During rendering the section index of a docs list it could happen that a file has no parent for e.g. the homepage. If such scenario is existing the .Parent.File of a file is nil. Therefore this case should be handled within the rendering itself. Fixes google#1874 Signed-off-by: Tobias Kohlbau <[email protected]>
During rendering the section index of a docs list it could happen that a file has no parent for e.g. the homepage. If such scenario is existing the .Parent.File of a file is nil. Therefore this case should be handled within the rendering itself. Fixes google#1874 Signed-off-by: Tobias Kohlbau <[email protected]>
During rendering the section index of a docs list it could happen that a file has no parent for e.g. the homepage. If such scenario is existing the .Parent.File of a file is nil. Therefore this case should be handled within the rendering itself. Fixes google#1874 Signed-off-by: Tobias Kohlbau <[email protected]>
During rendering the section index of a docs list it could happen that a file has no parent for e.g. the homepage. If such scenario is existing the .Parent.File of a file is nil. Therefore this case should be handled within the rendering itself. Fixes google#1874 Signed-off-by: Tobias Kohlbau <[email protected]>
During rendering the section index of a docs list it could happen that a file has no parent for e.g. the homepage. If such scenario is existing the .Parent.File of a file is nil. Therefore this case should be handled within the rendering itself. Fixes google#1874 Signed-off-by: Tobias Kohlbau <[email protected]>
During rendering the section index of a docs list it could happen that a file has no parent for e.g. the homepage. If such scenario is existing the .Parent.File of a file is nil. Therefore this case should be handled within the rendering itself. Fixes google#1874 Signed-off-by: Tobias Kohlbau <[email protected]>
During rendering the section index of a docs list it could happen that a file has no parent for e.g. the homepage. If such scenario is existing the .Parent.File of a file is nil. Therefore this case should be handled within the rendering itself. Fixes google#1874 Signed-off-by: Tobias Kohlbau <[email protected]>
During rendering the section index of a docs list it could happen that a file has no parent for e.g. the homepage. If such scenario is existing the .Parent.File of a file is nil. Therefore this case should be handled within the rendering itself. Fixes google#1874 Signed-off-by: Tobias Kohlbau <[email protected]>
During rendering the section index of a docs list it could happen that a file has no parent for e.g. the homepage. If such scenario is existing the .Parent.File of a file is nil. Therefore this case should be handled within the rendering itself. Fixes google#1874 Signed-off-by: Tobias Kohlbau <[email protected]>
During rendering the section index of a docs list it could happen that a file has no parent for e.g. the homepage. If such scenario is existing the .Parent.File of a file is nil. Therefore this case should be handled within the rendering itself. Fixes google#1874 Signed-off-by: Tobias Kohlbau <[email protected]>
Originally posted by @chulcher in #1863 (comment)
gohugoio/hugo#12068, specifically gohugoio/hugo#12068 (comment) relevant?
The text was updated successfully, but these errors were encountered: