I can't deploy with github actions

Guys I need help because I can’t figure out the problem.
The site works locally, but when I try to deploy on github I always get this error.


.
Start building sites …
hugo v0.123.0-3c8a4713908e48e6523f058ca126710397aa4ed5+extended linux/amd64 BuildDate=2024-02-19T16:32:38Z VendorInfo=gohugoio
WARN calling IsSet with unsupported type “invalid” () will always return false.
ERROR failed to process “/docs/helpdesk/guides/copia_dati/index.html”: “/tmp/hugo-transform-error611422725:1603:21”: unexpected } in expression on line 1603 and column 21
45: } catch (err) {
^
ERROR failed to process “/docs/helpdesk/guides/inplace/index.html”: “/tmp/hugo-transform-error59870334:1624:21”: unexpected } in expression on line 1624 and column 21
45: } catch (err) {
^
ERROR failed to process “/docs/helpdesk/guides/setup_dell_laptops/index.html”: “/tmp/hugo-transform-error3023614695:1639:21”: unexpected } in expression on line 1639 and column 21
45: } catch (err) {
^
ERROR failed to process “/docs/helpdesk/software/oracle/oracle_lntools/index.html”: “/tmp/hugo-transform-error1898247239:1639:21”: unexpected } in expression on line 1639 and column 21
45: } catch (err) {
^
Total in 15495 ms
Error: error building site: render: failed to render pages: failed to process “/docs/dev/pterodactyl/pterodactyl/index.html”: “/tmp/hugo-transform-error2013320630:2724:21”: unexpected } in expression on line 2724 and column 21
45: } catch (err) {
^
Error: Process completed with exit code 1.

if this is really the same code that builds locally … the github runner is linux and v 0.123 of hugo

and yours locally?

maybe locally you are on windows. encoding problem with your files …

  • case sensitiv

  • char encoding should be UTF8 (without BOM) for all files

  • maybe your input HTML(?) is broken

  • check especially the quotes, double quotes, AND back quotes - as it seems it brakes in some code snippets you want to render.

not much more to say without sources.

hugo states clearly which files have some syntax errors

try/catch was added in Hugo 0.141 so your used version of 0.123 does not support this.

After discussion with @irknode, we are both not 100% sure, what’s happening here. Please share a link to your repo.

I use the lotusdocs theme, the latest version supported by this theme is 0.131.0.
But the problem does not depend on this, even if I change version the problem persists.
The blog works locally on windows.

It works locally because you are not passing the --minify flag on the command line. Remove that flag from the GitHub workflow and the site will build.

It looks like this theme has been abandoned.

1 Like

My man!
I followed several guides and they all used pretty much similar settings; without your help I would never have fixed it.
Thanks hahaha

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