Closed strauhmanis closed 2 years ago
Your build commands doesn't look right. This theme is for Hugo, so your build command should be hugo
. You can see more details about deploying Hugo sites to Cloudflare Pages in their official docs:
I tried building with the hugo
command at a very first try, but there was even less build progress that way.
I tried once again and had a same unsuccessful result — please see the log below:
08:22:19.658 Initializing build environment. This may take up to a few minutes to complete 08:22:21.733 Success: Finished initializing build environment 08:22:21.733 Cloning repository... 08:22:23.962 Success: Finished cloning repository files 08:22:24.237 Installing dependencies 08:22:24.249 Python version set to 2.7 08:22:26.510 Attempting node version 'v16.14.2' from .nvmrc 08:22:28.228 Downloading and installing node v16.14.2... 08:22:28.727 Downloading https://nodejs.org/dist/v16.14.2/node-v16.14.2-linux-x64.tar.xz... 08:22:29.146 Computing checksum with sha256sum 08:22:29.281 Checksums matched! 08:22:33.797 Now using node v16.14.2 (npm v8.5.0) 08:22:34.385 Started restoring cached build plugins 08:22:34.401 Finished restoring cached build plugins 08:22:35.122 Attempting ruby version 2.7.1, read from environment 08:22:41.112 Using ruby version 2.7.1 08:22:41.482 Using PHP version 5.6 08:22:41.657 5.2 is already installed. 08:22:41.684 Using Swift version 5.2 08:22:41.685 Started restoring cached node modules 08:22:41.710 Finished restoring cached node modules 08:22:42.189 Installing NPM modules using NPM version 8.5.0 08:22:45.755 npm WARN deprecated @braintree/sanitize-url@3.1.0: Potential XSS vulnerability patched in v6.0.0. 08:22:47.689
08:22:47.689 > hugo-congo-theme@2.1.0 preinstall 08:22:47.689 > rimraf assets/vendor 08:22:47.689
08:22:47.803
08:22:47.804 > hugo-congo-theme@2.1.0 postinstall 08:22:47.804 > vendor-copy 08:22:47.804
08:22:47.905 /opt/buildhome/repo/node_modules/mermaid/dist/mermaid.min.js => /opt/buildhome/repo/assets/lib/mermaid/mermaid.min.js 08:22:47.905 /opt/buildhome/repo/node_modules/chart.js/dist/chart.min.js => /opt/buildhome/repo/assets/lib/chart/chart.min.js 08:22:47.905 /opt/buildhome/repo/node_modules/katex/dist/katex.min.js => /opt/buildhome/repo/assets/lib/katex/katex.min.js 08:22:47.905 /opt/buildhome/repo/node_modules/katex/dist/katex.min.css => /opt/buildhome/repo/assets/lib/katex/katex.min.css 08:22:47.906 /opt/buildhome/repo/node_modules/katex/dist/contrib/auto-render.min.js => /opt/buildhome/repo/assets/lib/katex/auto-render.min.js 08:22:47.906 /opt/buildhome/repo/node_modules/katex/dist/fonts/ => /opt/buildhome/repo/assets/lib/katex/fonts/ 08:22:47.906 /opt/buildhome/repo/node_modules/fuse.js/dist/fuse.min.js => /opt/buildhome/repo/assets/lib/fuse/fuse.min.js 08:22:47.941
08:22:47.941 added 203 packages, and audited 204 packages in 5s 08:22:47.941
08:22:47.941 23 packages are looking for funding 08:22:47.941 runnpm fund
for details 08:22:47.947
08:22:47.947 3 vulnerabilities (2 moderate, 1 high) 08:22:47.947
08:22:47.947 To address issues that do not require attention, run: 08:22:47.947 npm audit fix 08:22:47.947
08:22:47.948 To address all issues (including breaking changes), run: 08:22:47.948 npm audit fix --force 08:22:47.948
08:22:47.948 Runnpm audit
for details. 08:22:47.959 NPM modules installed 08:22:48.501 Installing Hugo 0.96.0 08:22:49.795 hugo v0.96.0-2fd4a7d3d6845e75f8b8ae3a2a7bd91438967bbb+extended linux/amd64 BuildDate=2022-03-26T09:15:58Z VendorInfo=gohugoio 08:22:49.801 Started restoring cached go cache 08:22:49.824 Finished restoring cached go cache 08:22:49.988 go version go1.14.4 linux/amd64 08:22:50.009 go version go1.14.4 linux/amd64 08:22:50.014 Installing missing commands 08:22:50.014 Verify run directory 08:22:50.014 Executing user command: hugo 08:22:50.058 Error: module "congo" not found; either add it as a Hugo Module or store it in "/opt/buildhome/repo/themes".: module does not exist 08:22:50.058 Total in 5 ms 08:22:50.068 Failed: build command exited with code: 255
Try installing congo as a submodule. I don't see any reference to hugo mods in the Cloudflare docs, only to installing themes as submodules.
Unless you specifically need to build a custom version of the theme you shouldn't need to run npm
as part of your site build. If you're using the manual installation method, simply build your site using the hugo
command.
08:22:50.058 Error: module "congo" not found; either add it as a Hugo Module or store it in "/opt/buildhome/repo/themes".: module does not exist
This error suggests that it can't find the theme. Does the directory themes/congo
exist in your deployment? If so, it may be that you are missing the line theme = "congo"
in your Hugo config file.
I've been able to deploy a Congo themed site successfully with Cloudflare pages.
I've installed Congo through a Git submodule. My config file is simply:
> cat config.toml
───────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ File: config.toml
───────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
1 │ theme = "congo"
───────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Build config (the default for Hugo):
Environment variable to use the latest version of Hugo:
Cloudflare log:
14:23:14.843 | Initializing build environment. This may take up to a few minutes to complete
-- | --
14:23:17.034 | Success: Finished initializing build environment
14:23:17.034 | Cloning repository...
14:23:20.498 | Success: Finished cloning repository files
14:23:20.822 | Installing dependencies
14:23:20.833 | Python version set to 2.7
14:23:24.930 | v12.18.0 is already installed.
14:23:26.309 | Now using node v12.18.0 (npm v6.14.4)
14:23:26.647 | Started restoring cached build plugins
14:23:26.663 | Finished restoring cached build plugins
14:23:27.370 | Attempting ruby version 2.7.1, read from environment
14:23:33.297 | Using ruby version 2.7.1
14:23:33.662 | Using PHP version 5.6
14:23:33.833 | 5.2 is already installed.
14:23:33.862 | Using Swift version 5.2
14:23:33.862 | Installing Hugo 0.96.0
14:23:34.996 | hugo v0.96.0-2fd4a7d3d6845e75f8b8ae3a2a7bd91438967bbb+extended linux/amd64 BuildDate=2022-03-26T09:15:58Z VendorInfo=gohugoio
14:23:35.001 | Started restoring cached go cache
14:23:35.028 | Finished restoring cached go cache
14:23:35.180 | go version go1.14.4 linux/amd64
14:23:35.201 | go version go1.14.4 linux/amd64
14:23:35.206 | Installing missing commands
14:23:35.206 | Verify run directory
14:23:35.206 | Executing user command: hugo
14:23:35.290 | Start building sites …
14:23:35.290 | hugo v0.96.0-2fd4a7d3d6845e75f8b8ae3a2a7bd91438967bbb+extended linux/amd64 BuildDate=2022-03-26T09:15:58Z VendorInfo=gohugoio
14:23:35.315 |
14:23:35.315 | \| EN
14:23:35.315 | -------------------+-----
14:23:35.315 | Pages \| 9
14:23:35.315 | Paginator pages \| 0
14:23:35.315 | Non-page files \| 0
14:23:35.315 | Static files \| 7
14:23:35.315 | Processed images \| 0
14:23:35.315 | Aliases \| 0
14:23:35.315 | Sitemaps \| 1
14:23:35.316 | Cleaned \| 0
14:23:35.316 |
14:23:35.316 | Total in 71 ms
14:23:35.326 | Finished
14:23:35.327 | Note: No functions dir at /functions found. Skipping.
14:23:35.327 | Validating asset output directory
14:23:35.948 | Deploying your site to Cloudflare's global network...
14:23:41.711 | Success: Your site was deployed!
Thank you all!
I'm now successfully building Congo Cloudflare Pages.
What happened?
Hello,
I'm having a trouble building Congo (manual install method) on Cloudflare Pages.
Build command = npm run build Build output directory = public
Please see the attached build log.
Would appreciate your comment, please.
Thank you!
Theme version
v2.1.0
Hugo version
v0.95.0
What browsers are you seeing the problem on?
Safari
Relevant Hugo log output