Error (windows only): add site dependencies: load resources: loading translations....invalid character

I am experiencing an error in a Windows hugo setup, as is a colleague who is also trying to run hugo on windows. I’m sure there’s something wrong with our setups / source content that is causing hugo to fail in windows. I also have an equivalent setup for the same site in Linux (ubuntu) and it works fine. Most of our team is unfortunately on Windows, so I need to get things set up so they can update documentation using hugo.

I’m running hugo v0.101.0 extended

I try to run this command:

hugo serve -D --panicOnWarning

The error I encounter is:

Error: add site dependencies: load resources: loading translations: "C:\Users\micha\src\plaidcloud-docs\i18n\de.toml:1:1": failed to load translations: toml: invalid character at start of key: .

I’ve opened the file and the include file referenced in UTF8 mode, and I see no out of the ordinary characters. I’ve also deleted the german (de) files entirely. That just causes the same error to be reported against the next language (en) instead of de.

Any help would most definitely be very much appreciated. We’re new to hugo as a company, but very excited to be using it for our documentation for our product. Thank you!

You could try an online TOML validator.

As to helping you further with this, I find that hard without access to the actual file.

Hi. I checked a bunch of files in an online TOML validator just now, and everything’s looking good. The site continues to run fine from a Linux environment & it fails from a Windows environment with the same content. I’m going share a reduced version of the site here as a zip.

If this is your project…
https://github.com/PlaidCloud/plaidcloud-docs

The files in the i18n directory are symbolic links to files in data/i18n. The symbolic links are valid with Linux, but not with Windows.

I’m not sure why you have set things up this way. If you need to access the i18n files as data files, I suggest you mount i18n under data.

See:
https://gohugo.io/hugo-modules/configuration/#module-config-mounts

2 Likes

@jmooring Thank you! Will look into this immediately. The link you shared is our project.
(GitHub - PlaidCloud/plaidcloud-docs)

I created a clone of it with most of the content stripped out of it here as well, but perhaps not needed: GitHub - rea725/plaidcloud-docs-test: test repo for debugging hugo

Post-mortem: We’d started our own documentation by cloning a public repo from a different site that we liked. They clearly weren’t using Windows. I wish we weren’t either :wink:

Big thank you @jmooring and also @bep for the help.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.