Skip to content
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

Can't replicate the Developping Hugo Modules tutorial. #1307

Open
oolonek opened this issue Dec 7, 2024 · 1 comment
Open

Can't replicate the Developping Hugo Modules tutorial. #1307

oolonek opened this issue Dec 7, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@oolonek
Copy link

oolonek commented Dec 7, 2024

Describe the bug

I am trying to follow the Developing Hugo Modules guide.

My repo as far is https://github.com/oolonek/mod-katex

All good until this point https://github.com/gethinode/docs/blob/5fefd052d14e7f9a2b39b81d2932635537d3372c/content/en/guides/modules/index.md?plain=1#L83.

After this step, when I try to push my commit the husky pre-commit script is ranting :

(base) ➜  mod-katex git:(develop) ✗ git commit

> @oolonek/[email protected] test
> npm run -s build

Total in 1 ms
Error: failed to create config from result: failed to decode "module": module workspace "/Users/pma/git_repos/oolonek/mod-katex/exampleSite/mod-katex.work" does not exist. Check your module.workspace setting (or HUGO_MODULE_WORKSPACE env var).
husky - pre-commit script failed (code 1)

What did I forget to do ?
Many thanks for your attention.

@oolonek oolonek added the bug Something isn't working label Dec 7, 2024
@oolonek
Copy link
Author

oolonek commented Dec 7, 2024

I realized that there was indeed no mod-katex.work under exampleSite. I have thus renamed the mod-template.work file to mod-katex.work. After a git add . and git commit I get :

(base) ➜  mod-katex git:(develop) ✗ git commit

> @oolonek/[email protected] test
> npm run -s build

go: github.com/oolonek/[email protected]: invalid version: unknown revision 216cbf0c7693
An unknown revision most likely means that someone has deleted the remote ref (e.g. with a force push to GitHub).
To resolve this, you need to manually edit your go.mod file and replace the version for the module in question with a valid ref.

The easiest is to just enter a valid branch name there, e.g. master, which would be what you put in place of 'v0.5.1' in the example below.

require github.com/gohugoio/hugo-mod-jslibs/instantpage v0.5.1

If you then run 'hugo mod graph' it should resolve itself to the most recent version (or commit if no semver versions are available).
hugo: collected modules in 1110 ms
Total in 1111 ms
Error: failed to load modules: failed to download modules: failed to execute 'go [mod download -modcacherw]': failed to execute binary "go" with args [mod download -modcacherw]: go: github.com/oolonek/[email protected]: invalid version: unknown revision 216cbf0c7693
 *errors.errorString
husky - pre-commit script failed (code 1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant