wangchucheng / hugo-eureka

Eureka is a feature-rich and highly customizable Hugo theme.
https://www.wangchucheng.com/en/docs/hugo-eureka/
Apache License 2.0
927 stars 193 forks source link

When I used cloudflare's pages to automatically build, the following error message appeared #152

Closed yuluod closed 2 years ago

yuluod commented 2 years ago

Describe the bug

When I used cloudflare's pages to automatically build, the following error message appeared.

To Reproduce

Does this issue reproduce with the latest release?

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

Environment

Additional context

11:04:29.708 Initializing build environment. This may take up to a few minutes to complete 11:06:39.403 Success: Finished initializing build environment 11:06:39.403 Cloning repository... 11:06:44.002 Success: Finished cloning repository files 11:06:44.885 Installing dependencies 11:06:44.889 Python version set to 2.7 11:06:46.022 v12.18.0 is already installed. 11:06:46.453 Now using node v12.18.0 (npm v6.14.4) 11:06:46.493 Started restoring cached build plugins 11:06:46.496 Finished restoring cached build plugins 11:06:46.609 Attempting ruby version 2.7.1, read from environment 11:06:47.544 Using ruby version 2.7.1 11:06:47.785 Using PHP version 5.6 11:06:47.814 5.2 is already installed. 11:06:47.819 Using Swift version 5.2 11:06:47.820 Installing Hugo 0.54.0 11:06:48.367 Hugo Static Site Generator v0.54.0-B1A82C61A/extended linux/amd64 BuildDate: 2019-02-01T10:04:38Z 11:06:48.368 Started restoring cached go cache 11:06:48.371 Finished restoring cached go cache 11:06:48.394 go version go1.14.4 linux/amd64 11:06:48.399 go version go1.14.4 linux/amd64 11:06:48.400 Installing missing commands 11:06:48.400 Verify run directory 11:06:48.400 Executing user command: hugo 11:06:48.441 Error: "/opt/buildhome/repo/themes/eureka/layouts/index.html:13:1": parse failed: template: index.html:13: function "warnf" not defined 11:06:48.444 Failed: build command exited with code: 255

wangchucheng commented 2 years ago

You seems to use Hugo 0.54.0 instead of 0.89.4 from log. Eureka must have a Hugo of 0.74 or above.

yuluod commented 2 years ago

➜ hugo version hugo v0.89.4+extended darwin/arm64 BuildDate=unknown

wangchucheng commented 2 years ago

You need to check the version cloudflare pages used, not the version in your computer. And this is what I saw from your build log:

11:06:47.820 Installing Hugo 0.54.0 11:06:48.367 Hugo Static Site Generator v0.54.0-B1A82C61A/extended linux/amd64 BuildDate: 2019-02-01T10:04:38Z

troycarpenter commented 2 years ago

I know this is closed, but I'm having a similar issue. I get the same error when I try to do a production build with Cloudflare. I do have the latest Hugo being installed. I've also tried some newer versions of other tools, but it doesn't work.

The failure log looks like this:

21:31:16.034 Initializing build environment. This may take up to a few minutes to complete 21:33:19.612 Success: Finished initializing build environment 21:33:19.612 Cloning repository... 21:33:23.089 Success: Finished cloning repository files 21:33:24.098 Installing dependencies 21:33:24.100 Python version set to 3.7 21:33:25.501 v12.18.0 is already installed. 21:33:25.934 Now using node v12.18.0 (npm v6.14.4) 21:33:25.973 Started restoring cached build plugins 21:33:25.977 Finished restoring cached build plugins 21:33:26.092 Attempting ruby version 2.7.1, read from environment 21:33:27.037 Using ruby version 2.7.1 21:33:27.280 Using PHP version 7.4 21:33:27.310 5.2 is already installed. 21:33:27.315 Using Swift version 5.2 21:33:27.316 Installing Hugo 0.54.0 21:33:28.006 Hugo Static Site Generator v0.54.0-B1A82C61A/extended linux/amd64 BuildDate: 2019-02-01T10:04:38Z 21:33:28.007 Started restoring cached go cache 21:33:28.010 Finished restoring cached go cache 21:33:28.010 Installing Go version 1.16 21:33:33.027
21:33:33.032 unset GOOS; 21:33:33.037 unset GOARCH; 21:33:33.037 export GOROOT='/opt/buildhome/.gimme_cache/versions/go1.16.linux.amd64'; 21:33:33.037 export PATH="/opt/buildhome/.gimme_cache/versions/go1.16.linux.amd64/bin:${PATH}"; 21:33:33.038 go version >&2; 21:33:33.038
21:33:33.038 export GIMME_ENV="/opt/buildhome/.gimme_cache/env/go1.16.linux.amd64.env" 21:33:33.042 go version go1.16 linux/amd64 21:33:33.043 Installing missing commands 21:33:33.043 Verify run directory 21:33:33.044 Executing user command: hugo 21:33:33.081 Error: "/opt/buildhome/repo/themes/eureka/layouts/partials/comment.html:3:1": parse failed: template: partials/comment.html:3: function "warnf" not defined 21:33:33.085 Failed: build command exited with code: 255

HOWEVER, the exact same code in the development build in Cloudflare works:

21:28:33.538 Initializing build environment. This may take up to a few minutes to complete 21:31:07.238 Success: Finished initializing build environment 21:31:07.238 Cloning repository... 21:31:08.884 Success: Finished cloning repository files 21:31:09.023 Installing dependencies 21:31:09.026 Python version set to 2.7 21:31:10.206 v12.18.0 is already installed. 21:31:10.791 Now using node v12.18.0 (npm v6.14.4) 21:31:10.840 Started restoring cached build plugins 21:31:10.844 Finished restoring cached build plugins 21:31:10.986 Attempting ruby version 2.7.1, read from environment 21:31:12.171 Using ruby version 2.7.1 21:31:12.477 Using PHP version 5.6 21:31:12.513 5.2 is already installed. 21:31:12.519 Using Swift version 5.2 21:31:12.520 Installing Hugo 0.91.0 21:31:13.667 hugo v0.91.0-D1DC0E9A+extended linux/amd64 BuildDate=2021-12-17T09:50:20Z VendorInfo=gohugoio 21:31:13.668 Started restoring cached go cache 21:31:13.671 Finished restoring cached go cache 21:31:13.701 go version go1.14.4 linux/amd64 21:31:13.706 go version go1.14.4 linux/amd64 21:31:13.708 Installing missing commands 21:31:13.708 Verify run directory 21:31:13.708 Executing user command: hugo 21:31:13.763 Start building sites … 21:31:13.763 hugo v0.91.0-D1DC0E9A+extended linux/amd64 BuildDate=2021-12-17T09:50:20Z VendorInfo=gohugoio 21:31:13.895
21:31:13.896 | EN
21:31:13.896 -------------------+----- 21:31:13.897 Pages | 57
21:31:13.897 Paginator pages | 1
21:31:13.897 Non-page files | 0
21:31:13.898 Static files | 0
21:31:13.898 Processed images | 3
21:31:13.898 Aliases | 12
21:31:13.899 Sitemaps | 1
21:31:13.899 Cleaned | 0
21:31:13.899
21:31:13.899 Total in 164 ms 21:31:13.904 Finished 21:31:13.904 Note: No functions dir at /functions found. Skipping. 21:31:13.904 Validating asset output directory 21:31:14.275 Deploying your site to Cloudflare's global network... 21:31:19.245 Success: Your site was deployed!

wangchucheng commented 2 years ago

For the first log, you are using Hugo 0.54.0 which is too old for eureka and you are using Hugo 0.91.0 for the second log. So the second one works.

在 2022年1月6日,22:43,Troy Carpenter @.***> 写道:



I know this is closed, but I'm having a similar issue. I get the same error when I try to do a production build with Cloudflare. I do have the latest Hugo being installed. I've also tried some newer versions of other tools, but it doesn't work.

The failure log looks like this:

21:31:16.034 Initializing build environment. This may take up to a few minutes to complete 21:33:19.612 Success: Finished initializing build environment 21:33:19.612 Cloning repository... 21:33:23.089 Success: Finished cloning repository files 21:33:24.098 Installing dependencies 21:33:24.100 Python version set to 3.7 21:33:25.501 v12.18.0 is already installed. 21:33:25.934 Now using node v12.18.0 (npm v6.14.4) 21:33:25.973 Started restoring cached build plugins 21:33:25.977 Finished restoring cached build plugins 21:33:26.092 Attempting ruby version 2.7.1, read from environment 21:33:27.037 Using ruby version 2.7.1 21:33:27.280 Using PHP version 7.4 21:33:27.310 5.2 is already installed. 21:33:27.315 Using Swift version 5.2 21:33:27.316 Installing Hugo 0.54.0 21:33:28.006 Hugo Static Site Generator v0.54.0-B1A82C61A/extended linux/amd64 BuildDate: 2019-02-01T10:04:38Z 21:33:28.007 Started restoring cached go cache 21:33:28.010 Finished restoring cached go cache 21:33:28.010 Installing Go version 1.16 21:33:33.027 21:33:33.032 unset GOOS; 21:33:33.037 unset GOARCH; 21:33:33.037 export GOROOT='/opt/buildhome/.gimme_cache/versions/go1.16.linux.amd64'; 21:33:33.037 export PATH="/opt/buildhome/.gimme_cache/versions/go1.16.linux.amd64/bin:${PATH}"; 21:33:33.038 go version >&2; 21:33:33.038 21:33:33.038 export GIMME_ENV="/opt/buildhome/.gimme_cache/env/go1.16.linux.amd64.env" 21:33:33.042 go version go1.16 linux/amd64 21:33:33.043 Installing missing commands 21:33:33.043 Verify run directory 21:33:33.044 Executing user command: hugo 21:33:33.081 Error: "/opt/buildhome/repo/themes/eureka/layouts/partials/comment.html:3:1": parse failed: template: partials/comment.html:3: function "warnf" not defined 21:33:33.085 Failed: build command exited with code: 255

HOWEVER, the exact same code in the development build in Cloudflare works:

21:28:33.538 Initializing build environment. This may take up to a few minutes to complete 21:31:07.238 Success: Finished initializing build environment 21:31:07.238 Cloning repository... 21:31:08.884 Success: Finished cloning repository files 21:31:09.023 Installing dependencies 21:31:09.026 Python version set to 2.7 21:31:10.206 v12.18.0 is already installed. 21:31:10.791 Now using node v12.18.0 (npm v6.14.4) 21:31:10.840 Started restoring cached build plugins 21:31:10.844 Finished restoring cached build plugins 21:31:10.986 Attempting ruby version 2.7.1, read from environment 21:31:12.171 Using ruby version 2.7.1 21:31:12.477 Using PHP version 5.6 21:31:12.513 5.2 is already installed. 21:31:12.519 Using Swift version 5.2 21:31:12.520 Installing Hugo 0.91.0 21:31:13.667 hugo v0.91.0-D1DC0E9A+extended linux/amd64 BuildDate=2021-12-17T09:50:20Z VendorInfo=gohugoio 21:31:13.668 Started restoring cached go cache 21:31:13.671 Finished restoring cached go cache 21:31:13.701 go version go1.14.4 linux/amd64 21:31:13.706 go version go1.14.4 linux/amd64 21:31:13.708 Installing missing commands 21:31:13.708 Verify run directory 21:31:13.708 Executing user command: hugo 21:31:13.763 Start building sites … 21:31:13.763 hugo v0.91.0-D1DC0E9A+extended linux/amd64 BuildDate=2021-12-17T09:50:20Z VendorInfo=gohugoio 21:31:13.895 21:31:13.896 | EN 21:31:13.896 -------------------+----- 21:31:13.897 Pages | 57 21:31:13.897 Paginator pages | 1 21:31:13.897 Non-page files | 0 21:31:13.898 Static files | 0 21:31:13.898 Processed images | 3 21:31:13.898 Aliases | 12 21:31:13.899 Sitemaps | 1 21:31:13.899 Cleaned | 0 21:31:13.899 21:31:13.899 Total in 164 ms 21:31:13.904 Finished 21:31:13.904 Note: No functions dir at /functions found. Skipping. 21:31:13.904 Validating asset output directory 21:31:14.275 Deploying your site to Cloudflare's global network... 21:31:19.245 Success: Your site was deployed!

— Reply to this email directly, view it on GitHubhttps://github.com/wangchucheng/hugo-eureka/issues/152#issuecomment-1007116945, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJEXGNHASW2HBP7J3ZPDUELUUZOMRANCNFSM5JYERIDQ. You are receiving this because you modified the open/close state.Message ID: @.***>

troycarpenter commented 2 years ago

Good eye. I had the HUGO_VERSION environment variable spelled wrong in the production settings and never noticed it before. Sorry to have bothered.