-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Provide backtrace to the point in template where a function gets called over "nil" #4710
Comments
This indeed would shorten many debugging situations. I've got a tiny tear in my eyes now when I see this dreaded error. |
I'm unable to reproduce this issue now. Can anyone confirm? I have an old v0.54.0 binary, and it shows better results even back then. Not sure what version of Go I used to compile it, though (PS - maybe we should output the Go runtime version in our Here's the changes I tested against the
Output:
|
@moorereason this is fixed. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Reference: https://discourse.gohugo.io/t/runtime-error-invalid-memory-address-or-nil-pointer-dereference/11881/12?u=kaushalmodi
An example problematic template snippet:
Now if that
(.Site.GetPage "taxonomyTerm" "categories" "foo")
returns nil,hugo
would only print something like:That error does not mean that the referenced
index.html
has the problematic statement.. the error could be in any of the nested partials in that file. So the debug becomes time-consuming as you comment/uncomment the template files in halves to narrow down to the actual buggy line in the template.The text was updated successfully, but these errors were encountered: