-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Multi-lingual site translation panic error #2174
Comments
Please use http://discuss.gohugo.io/ for troubleshooting/questions. |
@bep I'm pretty certain that the Hugo binary throwing a panic in the viper library goes beyond troubleshooting. I've fixed the issue in my project using Hugo but I figured opening an issue here would be helpful to the Hugo community and make the issue visible because this seems like an issue introduced when Multi-lingual support was added to Hugo. A go panic because a property is missing from the config file doesn't really help anyone trying to learn how to use Hugo. I know that discussions on troubleshooting the library or helping others in the community should be opened in the Discourse app, but this error message can be tied to the source code. I could go ahead and open another issue in @spf13's viper, it seemed like this was in error in Hugo since it was about language support and not about reading the config. Let me know if I can help out with this in anyway, rather than keeping this bug in the source or working around the bug like I did above. |
There isn't a "multi-lingual" feature in Hugo. The stack trace indicates a nil pointer inside a template, which could be anything, panics are hard to avoid totally (we could recover, but we'll not doing that). Oh, and lots of stuff have happened in Hugo since 0.15. If you have further questions, please take it on the forum. Until I'm convinced that this issue is something that is "actionable", I'm closing this. We have a limited set of support resources, so this is keeping it as effective as possible. |
Hi @rogeruiz,
Could you please tell us which version of Hugo you used when this happened? Was it:
because AFAIK Hugo does not yet have native multilingual supported added to it yet, except a temporary but good solution contributed by a Hugo user in It would also be helpful if you could provide the source to an example minimal website so we could try to reproduce the error that you encountered. Many thanks! |
Hey @anthonyfok, We're using the Thanks. |
@rogeruiz: Thank you for your added information. I would recommend that you try to build Hugo from source (or wait for the 0.16, which is happening within this week or even sooner) and see if it solves your problem. Lots of fixes have gone into the eight months of development between the two releases, so it is likely that the problem has been solved. As both @ bep and I pointed out, Hugo does not yet have any native multilingual support, not even for 0.16, so the problem you ran into seems more like using a variable without declaring it first, and that variable happens to be Cheers, |
Further to what @rogeruiz was saying, and on the same project: Bug still appears present in 0.16. I believe it happens when using |
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. |
Description
I'm currently working on a project which uses Hugo to build a multi-lingual site. When running the following command:
hugo --baseURL="https://vote-gov-staging.apps.cloud.gov"
with the following
config*
files:config.toml
config_en.toml
config_es.toml
and no
lang
property in theconfig.toml
is causing the following issue /panic
:Error
Adding a
lang = "en-US"
to theconfig.toml
fixes the issue and causes Hugo to build properlyFix
Hypothesis
It seems like the issue is in regards to not having the
lang = "en-US"
in the default config file. I think I've tracked it down to thetranslations
directory containing twoyaml
files which reflect thelang = "*"
within each configuration file. With thelang = "*"
missing and thetranslations/*.yml
files existing, the panic occurs.I would love to help with debugging this issue further and even contributing some documentation around troubleshooting this error in the docs. Let me know how I can help. Thanks!
The text was updated successfully, but these errors were encountered: