Closed 404missinglink closed 3 weeks ago
This bug is now fixed.
tailwindcss was in dev dependencies preventing it from loading at build time in production.
"devDependencies": {
"autoprefixer": "^10.4.19",
"postcss": "^8.4.38",
"tailwindcss": "^3.4.3"
}
I moved the dependencies around and dropped the redundant fontawesome package.
"devDependencies": {
"postcss-cli": "^11.0.0",
"concurrently": "^8.2.2"
},
"dependencies": {
"@tailwindcss/typography": "^0.5.13",
"autoprefixer": "^10.4.19",
"postcss": "^8.4.38",
"tailwindcss": "^3.4.3",
"concurrently": "^8.2.2",
"cssnano": "^7.0.1",
"cssnano-preset-advanced": "^7.0.1",
"postcss-cli": "^11.0.0",
"terser": "^5.30.4"
},
I'm encountering an issue with my Hugo site when it's built on Cloudflare Pages. The Tailwind CSS is not being properly generated during the build process, resulting in the deployed site relying on the CSS that was previously built in my local development environment.
This is causing inconsistencies between my local development version and the live site deployed on Cloudflare Pages.
Steps to reproduce:
Expected behavior: When the Hugo site is built on Cloudflare Pages, it should properly generate the Tailwind CSS based on the latest changes made to the site's templates and content. The deployed site should reflect the same styles as the local development version.
Actual behavior: The Tailwind CSS is not being generated during the Cloudflare Pages build process. The deployed site is using the CSS that was previously built in the local development environment, which may be outdated or inconsistent with the latest changes.
Suggested fix: To resolve this issue, we can try updating the
build
script in thepackage.json
file to include the Tailwind CSS compilation step before running the Hugo build command. Here's the suggested modification:This updated
build
script will first run thebuild:tw
command to compile the Tailwind CSS and then run the Hugo build command. By including the Tailwind CSS compilation step in the build process, we ensure that the latest changes to the Tailwind CSS are reflected in the generated CSS file.Please update the
package.json
file with the modifiedbuild
script and trigger a new build on Cloudflare Pages to see if this resolves the issue.Additional information:
package.json
: https://github.com/takara-ai/Website/blob/031f32f371b71c7652931b138b83ee522ff9a2fe/package.jsonI've checked the Hugo configuration and the Tailwind CSS integration, and everything works fine in my local development environment. The issue only occurs when building on Cloudflare Pages.