nusserstudios / tailbliss

TailBliss is a Hugo Starter theme built on TailwindCSS 3, and Alpine.JS.
https://tailbliss.netlify.app/
Apache License 2.0
289 stars 134 forks source link

Issues deploying on Netlify but everything works locally #123

Closed obicho closed 1 year ago

obicho commented 1 year ago

I am getting these issues on Netlify:

3:55:19 PM: ERROR 2023/06/27 22:55:19 failed to render pages: render of home failed: /opt/build/repo/layouts/index.html:53:48: execute of template failed: template: index.html:53:48: executing main at <resources.Get>: error calling Get: dirs not supported resource types: &{0xc00136c990 0xc000d78640} 3:55:19 PM: Error: Error building site: JSBUILD: failed to transform js/alpine.js (text/javascript): /opt/build/repo/assets/js/alpine.js:1:19: Could not resolve jslibs/alpinejs/v3/alpinejs/dist/module.esm.js

But everything is ok locally.

Including the entire log here from Netlify.

Initializing - Passed

3:54:58 PM: build-image version: c11c0eb9939c949586b0f78302107908b668a11e (focal)
3:54:58 PM: buildbot version: 55489dea6ef0428412532c40d27c9bef94a7fd4a
3:54:58 PM: Fetching cached dependencies
3:54:58 PM: Failed to fetch cache, continuing with build
3:54:58 PM: Starting to prepare the repo for build
3:54:58 PM: No cached dependencies found. Cloning fresh repo
3:54:58 PM: git clone --filter=blob:none https://github.com/obicho/tailbliss-test
3:54:58 PM: Preparing Git Reference refs/heads/main
3:55:00 PM: Starting to install dependencies
3:55:00 PM: Python version set to 3.8
3:55:00 PM: Attempting Ruby version 2.7.2, read from environment
3:55:00 PM: Using Ruby version 2.7.2
3:55:01 PM: Started restoring cached go cache
3:55:01 PM: Finished restoring cached go cache
3:55:02 PM: go version go1.19.10 linux/amd64
3:55:03 PM: Using PHP version 8.0
3:55:03 PM: Installing Hugo 0.105.0
3:55:04 PM: hugo v0.105.0-0e3b42b4a9bdeb4d866210819fc6ddcf51582ffa+extended linux/amd64 BuildDate=2022-10-28T12:29:05Z VendorInfo=gohugoio
3:55:05 PM: Downloading and installing node v18.16.1...
3:55:05 PM: Downloading https://nodejs.org/dist/v18.16.1/node-v18.16.1-linux-x64.tar.xz...
3:55:05 PM: Computing checksum with sha256sum
3:55:05 PM: Checksums matched!
3:55:07 PM: Now using node v18.16.1 (npm v9.5.1)
3:55:07 PM: Enabling Node.js Corepack
3:55:07 PM: Started restoring cached build plugins
3:55:07 PM: Finished restoring cached build plugins
3:55:07 PM: Started restoring cached corepack dependencies
3:55:07 PM: Finished restoring cached corepack dependencies
3:55:07 PM: No npm workspaces detected
3:55:07 PM: Started restoring cached node modules
3:55:07 PM: Finished restoring cached node modules
3:55:08 PM: Installing npm packages using npm version 9.5.1
3:55:16 PM: added 145 packages, and audited 146 packages in 8s
3:55:16 PM: 31 packages are looking for funding
3:55:16 PM:   run `npm fund` for details
3:55:16 PM: found 0 vulnerabilities
3:55:16 PM: npm packages installed
3:55:16 PM: Install dependencies script success
3:55:16 PM: Starting build script
3:55:17 PM: Detected 0 framework(s)
3:55:17 PM: Section completed: initializing

Building - Failed

3:55:21 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
3:55:18 PM: Netlify Build                                                 
3:55:18 PM: ────────────────────────────────────────────────────────────────
3:55:18 PM: ​
3:55:18 PM: ❯ Version
3:55:18 PM:   @netlify/build 29.12.1
3:55:18 PM: ​
3:55:18 PM: ❯ Flags
3:55:18 PM:   baseRelDir: true
3:55:18 PM:   buildId: 649b68c0e81886008029f6f7
3:55:18 PM:   deployId: 649b68c0e81886008029f6f9
3:55:18 PM:   tracing:
3:55:18 PM:     enabled: 'false'
3:55:18 PM:     host: 10.65.159.57
3:55:18 PM:     parentSpanId: b08444aa644df82c
3:55:18 PM:     traceFlags: '01'
3:55:18 PM:     traceId: e7573e97bab37e1f0b3c87c7d830154b
3:55:18 PM: ​
3:55:18 PM: ❯ Current directory
3:55:18 PM:   /opt/build/repo
3:55:18 PM: ​
3:55:18 PM: ❯ Config file
3:55:18 PM:   /opt/build/repo/netlify.toml
3:55:18 PM: ​
3:55:18 PM: ❯ Context
3:55:18 PM:   production
3:55:18 PM: ​
3:55:18 PM: build.command from netlify.toml                               
3:55:18 PM: ────────────────────────────────────────────────────────────────
3:55:18 PM: ​
3:55:18 PM: $ hugo --gc --minify
3:55:18 PM: Start building sites …
3:55:18 PM: hugo v0.105.0-0e3b42b4a9bdeb4d866210819fc6ddcf51582ffa+extended linux/amd64 BuildDate=2022-10-28T12:29:05Z VendorInfo=gohugoio
3:55:19 PM: ERROR 2023/06/27 22:55:19 failed to render pages: render of home failed: /opt/build/repo/layouts/index.html:53:48: execute of template failed: template: index.html:53:48: executing main at <resources.Get>: error calling Get: dirs not supported resource types: &{0xc00136c990 0xc000d78640}
3:55:19 PM: Error: Error building site: JSBUILD: failed to transform js/alpine.js (text/javascript): /opt/build/repo/assets/js/alpine.js:1:19: Could not resolve jslibs/alpinejs/v3/alpinejs/dist/module.esm.js
3:55:19 PM: Total in 1429 ms
3:55:19 PM: ​
3:55:19 PM: build.command failed                                        
3:55:19 PM: ────────────────────────────────────────────────────────────────
3:55:19 PM: ​
3:55:19 PM:   Error message
3:55:19 PM:   Command failed with exit code 255: hugo --gc --minify (https://ntl.fyi/exit-code-255)
3:55:19 PM: ​
3:55:19 PM:   Error location
3:55:19 PM:   In build.command from netlify.toml:
3:55:19 PM:   hugo --gc --minify
3:55:19 PM: ​
3:55:19 PM:   Resolved config
3:55:19 PM:   build:
3:55:19 PM:     command: hugo --gc --minify
3:55:19 PM:     commandOrigin: config
3:55:19 PM:     environment:
3:55:19 PM:       - HUGO_VERSION
3:55:19 PM:       - HUGO_ENV
3:55:19 PM:       - HUGO_ENABLEGITINFO
3:55:19 PM:     publish: /opt/build/repo/public
3:55:19 PM:     publishOrigin: config
3:55:19 PM:   redirects:
3:55:21 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
3:55:21 PM: Failing build: Failed to build site
3:55:21 PM: Finished processing build request in 23.762s
robot297 commented 1 year ago

I also ran into this issue and here's the commit that seemed to resolve it.

In case you can't see it, I am using hugo version 0.115.0 locally and updated the netlify.toml file to reflect that.

Hope this helps!

nusserstudios commented 1 year ago

Its just the Hugo Mod. I will set it up to pull from the alpine.js cdn script, tomorrow if I can.

curiousgeorgios commented 1 year ago

I'm also having the same issue. Any idea of how we can fix it temporarily? I have tried updating my netflify.toml file and also tried adding to baseof.html but no luck so far...

EDIT: Nvm - I realised I that for some reason APT decides to install v0.92.2, I have upgraded to v0.115.1 and it all works :)

nusserstudios commented 1 year ago

I removed hugo mods in favor of Alpine CDN.