Skip to content

After upgrade build fails #176

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

Open
1 task done
peter-pr opened this issue Feb 22, 2025 · 5 comments
Open
1 task done

After upgrade build fails #176

peter-pr opened this issue Feb 22, 2025 · 5 comments

Comments

@peter-pr
Copy link

What is your Hugo Extended Version

hugo v0.144.2+extended+withdeploy darwin/amd64

What is your Go Version

go1.24.0 darwin/amd64

What is your Node.js Version

node@v23.7.0

What is your Operating System

mac

Check for Existing Issues

  • I have searched and found no relevant issues.

Expected Behavior

npm run dev to be successful, but its not

Steps to Reproduce

npm run dev

Start building sites …
hugo v0.144.2+extended+withdeploy darwin/amd64 BuildDate=2025-02-19T12:17:04Z VendorInfo=brew

Built in 1398 ms
Error: error building site: TAILWINDCSS: failed to transform "/css/main.css" (text/css): Error: Failed to find 'tailwindcss'
in [
mysite/website/mysite-site
at /node_modules/postcss-import/lib/resolve-id.js:35:13
/node_modules/postcss/lib/lazy-result.js:293:11)
/node_modules/tailwindcss/lib/cli/build/index.js:49:9)

Code Reproduction URL

No response

Additional Information

I ran these before npm run dev

npm run update-theme
npm run update-modules

@pasdengl
Copy link

The issue seems to have been introduced in commit 02085ff. Before that the build runs smoothly.

@tfsomrat
Copy link
Contributor

tfsomrat commented Feb 23, 2025

Hey @pasdengl, can you share your repository? Also, it's a big update, and many dependencies have been changed. So it's recommended that you fork or clone the latest code instead of using the update-theme script.

@Anth0rx
Copy link

Anth0rx commented Feb 25, 2025

@tfsomrat We use Hugoplate here and run into the same problem. We use Hugoplate as a submodule in themes/hugoplate and pull in the latest changes occasionally. We do dot use the update-theme script.

Initially we used npm run project-setup to set up the example project and make custom changes in layouts folder.

@Anth0rx
Copy link

Anth0rx commented Mar 18, 2025

@tfsomrat I managed to update to the latest version of Hugoplate for our site with a set of manual changes.

Especially the changed keys in theme.json caused the issue:

Error: Cannot apply unknown utility class: text-text-dark

This has not been obvious, since the string text-text-dark is not declared anywhere, but instead is put together from theme.json.

@suzannealdrich
Copy link

I ran into a similar issue after updating Hugo, which caused the build for my site to fail. I had originally created my repo from the hugoplate template, so syncing in the latest theme changes was tricky. I wanted to preserve commit history and properly merge upstream changes instead of copying files over.

What worked for me

Following this Stack Overflow answer, I was able to rebase and merge the theme updates into my project.

Here’s what I did:

  1. Added the original theme repo as a remote
    I named it template:

    git remote add template git@github.com:zeon-studio/hugoplate.git
    git fetch template
  2. Identified commit hashes

    • ORIGINAL_COMMIT_ID: The commit from hugoplate I originally based my repo on
    • YOUR_FIRST_COMMIT: The first commit in my own repo (sjaconsulting)
      (You can get this by running: git rev-list --max-parents=0 HEAD)
  3. Rebased my work onto the upstream commit
    I followed this pattern:

    git rebase --onto ORIGINAL_COMMIT_ID YOUR_FIRST_COMMIT master
  4. Merged in the latest changes from hugoplate

    git merge template/master
  5. Resolved conflicts by hand, especially around config and customizations.

  6. Force pushed the new history (since I had rebased):

    git push --force

You can see my rebase commit here:
👉 sjaconsulting/sjaconsulting@3e60167

After this, both npm run dev and npm run build started working again 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants