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

Hugo 0.119 no longer builds - issue with js html template parsing #11507

Closed
Samreay opened this issue Sep 27, 2023 · 4 comments · Fixed by #11771
Closed

Hugo 0.119 no longer builds - issue with js html template parsing #11507

Samreay opened this issue Sep 27, 2023 · 4 comments · Fixed by #11771

Comments

@Samreay
Copy link

Samreay commented Sep 27, 2023

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

$ hugo version
hugo v0.119.0-b84644c008e0dc2c4b67bd69cccf87a41a03937e+extended linux/amd64 BuildDate=2023-09-24T15:20:17Z VendorInfo=brew

Does this issue reproduce with the latest release?

Yup

What is the issue?

Since upgrading to 0.119, my site no longer builds. I spent some time deleting things out to come to a reproducible HTML template.

This list.html template works with 0.119:

{{ define "main" }}

<script type="module">
  const posts = [];
  const card_template = html`<div>${() => posts.map(post => html``)}</div>`
</script>

<h1>{{ .Title }}</h1>

{{ end }}

This list.html does not:

{{ define "main" }}

<script type="module">
  const posts = [];
  const card_template = html`<div>${() => posts.map(post => html`<p></p>`)}</div>`
</script>

<h1>{{ .Title }}</h1>

{{ end }}

My site builds some reactivity in the front end up using arrow.js and Hugo simply populats a big old JSON object to use. It seems like nested js HTML templates are no longer allowed in the validation, which means I'll need to roll back until that's supported. @jmooring directed me to this backend ticket: https://go-review.googlesource.com/c/go/+/507995

@Samreay Samreay changed the title Hugo 0.119 no longer builds - regression with html validation parsing Hugo 0.119 no longer builds - regression with js html template parsing Sep 27, 2023
@Samreay Samreay changed the title Hugo 0.119 no longer builds - regression with js html template parsing Hugo 0.119 no longer builds - issue with js html template parsing Sep 27, 2023
@bep bep added Upstream and removed NeedsTriage labels Sep 28, 2023
@bep bep added this to the v0.120.0 milestone Sep 28, 2023
@Samreay
Copy link
Author

Samreay commented Oct 13, 2023

Hey @bep, I noticed this has the upstream tag on it - do you know what upstream project I should raise an issue with and chase it there to try and reduce the number of things to keep track of by the hugo team? :)

@jmooring
Copy link
Member

This might be resolved in Go 1.22 with https://go-review.googlesource.com/c/go/+/507995 (merged 2 Oct 2023).

@bep
Copy link
Member

bep commented Nov 29, 2023

Note that we run with a "soft fork" of Go's template packages, so if this is merged upstream and is important enough for us, we could consider pulling this in before Go 1.22 gets released.

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 Dec 26, 2023
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.

3 participants