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

Dev server is broken in 0.99 when using the Multilingual Multihost mode #9901

Closed
freud14 opened this issue May 16, 2022 · 2 comments · Fixed by #9905
Closed

Dev server is broken in 0.99 when using the Multilingual Multihost mode #9901

freud14 opened this issue May 16, 2022 · 2 comments · Fixed by #9905
Assignees
Milestone

Comments

@freud14
Copy link

freud14 commented May 16, 2022

The dev mode for Multilingual Multihost seems to be broken in 0.99. It is not broken in 0.98. Here are the steps to reproduce.

  • Create a new site:
    hugo new site quickstart
  • Edit config.toml:
    defaultContentLanguage = 'en'
    [languages]
      [languages.en]
        baseURL = 'https://example.com'
        title = 'My blog'
        weight = 1
      [languages.fr]
        baseURL = 'https://example.fr'
        title = 'Mon blogue'
        weight = 2
  • Run:
    hugo server
    resulting in:
    panic: runtime error: index out of range [1] with length 1
    
    goroutine 1 [running]:
    github.com/gohugoio/hugo/commands.(*serverCmd).server.func1(0xc000301770)
            /root/project/hugo/commands/server.go:222 +0x6e5
    github.com/gohugoio/hugo/commands.(*commandeer).loadConfig(0xc000301770)
            /root/project/hugo/commands/commandeer.go:390 +0x702
    github.com/gohugoio/hugo/commands.newCommandeer(0x1, 0x1, 0x1, 0xc000301590, {0x2874040?, 0xc000370bc0}, 0xc0003dd9a0, {0x0, 0x0, 0x0})
            /root/project/hugo/commands/commandeer.go:226 +0x310
    github.com/gohugoio/hugo/commands.initializeConfig(0x0?, 0x0?, 0x0?, 0x22fabba?, {0x2874040?, 0xc000370bc0?}, 0x1d0?)
            /root/project/hugo/commands/hugo.go:125 +0x31
    github.com/gohugoio/hugo/commands.(*serverCmd).server(0xc000370bc0, 0xc000213900, {0xc00024c500?, 0xa56e40?, 0xc0007ffd00?})
            /root/project/hugo/commands/server.go:249 +0x1cd
    github.com/gohugoio/hugo/commands.(*commandsBuilder).newServerCmdSignaled.func1(0xc000213900?, {0x39fa650?, 0x0?, 0x0?})
            /root/project/hugo/commands/server.go:96 +0x36
    github.com/spf13/cobra.(*Command).execute(0xc000213900, {0x39fa650, 0x0, 0x0})
            /go/pkg/mod/github.com/spf13/[email protected]/command.go:856 +0x67c
    github.com/spf13/cobra.(*Command).ExecuteC(0xc00084f400)
            /go/pkg/mod/github.com/spf13/[email protected]/command.go:974 +0x3b4
    github.com/gohugoio/hugo/commands.Execute({0xc00003c050, 0x1, 0x1})
            /root/project/hugo/commands/hugo.go:92 +0xb4
    main.main()
            /root/project/hugo/main.go:23 +0x57

If you remove the baseURL fields, the hugo server command seems to work as expected.

What version of Hugo are you using (hugo version)?

$ hugo version
hugo v0.99.0-1de333e7a3fc863672ec6d6cd53ba66dbcdd2305+extended linux/amd64 BuildDate=2022-05-16T08:10:56Z VendorInfo=gohugoio

Does this issue reproduce with the latest release?

It does with 0.99. The problem is not there in 0.98.

@freud14 freud14 changed the title Multilingual Multihost in dev mode is broken in 0.99 Dev server is broken in 0.99 when using the Multilingual Multihost mode May 16, 2022
@rodrigoalcarazdelaosa
Copy link

rodrigoalcarazdelaosa commented May 17, 2022

Happening to me as well with my repo, which built without issues with v0.98. I (and Netlify too) can build my site correctly running hugo even with v0.99 though, so the problem is only with hugo server.

@bep bep removed the NeedsTriage label May 18, 2022
@bep bep self-assigned this May 18, 2022
@bep bep added this to the 0.99.1 milestone May 18, 2022
bep added a commit to bep/hugo that referenced this issue May 18, 2022
As introduced in v0.99.0.

Fixes gohugoio#9901
bep added a commit to bep/hugo that referenced this issue May 18, 2022
As introduced in v0.99.0.

Fixes gohugoio#9901
@bep bep closed this as completed in #9905 May 18, 2022
bep added a commit that referenced this issue May 18, 2022
As introduced in v0.99.0.

Fixes #9901
@github-actions
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 Jun 12, 2022
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.

4 participants
@bep @freud14 @rodrigoalcarazdelaosa and others