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

Repeatable panic when editing i18n file, triggered after opening browser #12048

Closed
jmooring opened this issue Feb 16, 2024 · 1 comment · Fixed by #12050
Closed

Repeatable panic when editing i18n file, triggered after opening browser #12048

jmooring opened this issue Feb 16, 2024 · 1 comment · Fixed by #12050
Assignees
Milestone

Comments

@jmooring
Copy link
Member

jmooring commented Feb 16, 2024

Found when testing that #12039 was resolved with hugo v0.123.0-DEV-f1491c900e.

To reproduce:

  1. Close browser tab if open

  2. Clone and start server

    git clone --single-branch -b hugo-github-issue-12047 https://github.com/jmooring/hugo-testing hugo-github-issue-12047
    cd hugo-github-issue-12047
    hugo server
    
  3. While server is running, modify i18n/en.toml, changing foo = "FOO_EN" to foo = "FOO_ENsomething" (it doesn't matter which of the i18n files you modify).

  4. Now point your browser to http://localhost:1313/... bang.

console log
Change detected, rebuilding site (#7).
2024-02-16 07:23:12.605 -0800
i18n changed /de.toml
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x134f82c]

goroutine 1076 [running]:
github.com/gohugoio/hugo/tpl/internal/go_templates/htmltemplate.(*Template).New(0x0?, {0xc000f0cdf8?, 0x4?})
        /home/jmooring/code/hugo/tpl/internal/go_templates/htmltemplate/template.go:306 +0x2c
github.com/gohugoio/hugo/tpl/tplimpl.(*templateHandler).applyBaseTemplate(0x0?, {{0xc000f0cdf8, 0x12}, {0xc0005628c0, 0x1b1}, 0x0, 0x0, 0xc0009c7380}, {{0xc000f0cde0, 0x14}, ...})
        /home/jmooring/code/hugo/tpl/tplimpl/template.go:714 +0x385
github.com/gohugoio/hugo/tpl/tplimpl.(*templateHandler).findLayout(_, {{0x28a2eab, 0x4}, {0x0, 0x0}, {0x28a2feb, 0x4}, {0x0, 0x0}, {0xc00092591c, ...}, ...}, ...)
        /home/jmooring/code/hugo/tpl/tplimpl/template.go:495 +0x393
github.com/gohugoio/hugo/tpl/tplimpl.(*templateHandler).LookupLayout(_, {{0x28a2eab, 0x4}, {0x0, 0x0}, {0x28a2feb, 0x4}, {0x0, 0x0}, {0xc00092591c, ...}, ...}, ...)
        /home/jmooring/code/hugo/tpl/tplimpl/template.go:398 +0x2ca
github.com/gohugoio/hugo/hugolib.(*pageState).resolveTemplate(0xc0006e5650, {0x0, 0x0, 0x6c2e736968747b29?})
        /home/jmooring/code/hugo/hugolib/page.go:474 +0x198
github.com/gohugoio/hugo/hugolib.pageRenderer(0xc00103aa50, 0xc000b36600, 0x722e736968743a72?, 0x2c726564616f6c65?, 0xc00104af98?)
        /home/jmooring/code/hugo/hugolib/site_render.go:145 +0x25d
created by github.com/gohugoio/hugo/hugolib.(*Site).renderPages in goroutine 12
        /home/jmooring/code/hugo/hugolib/site_render.go:80 +0x107

@bep bep removed the NeedsTriage label Feb 16, 2024
@bep bep added this to the v0.123.0 milestone Feb 16, 2024
@bep bep self-assigned this Feb 17, 2024
bep added a commit to bep/hugo that referenced this issue Feb 17, 2024
bep added a commit to bep/hugo that referenced this issue Feb 17, 2024
bep added a commit that referenced this issue Feb 17, 2024
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants