Hi! Since Oct 18 all my deploys are failing (but the deploy preview is generated somehow).
If I go to the Netlify Dashboard and I retry clearing the cache, then it deploys successfully. But then it fails again if I create a new PR, I push a new commit or I merge to main.
The error I get is:
Cannot find module '@tailwindcss/forms'
Cannot find module '@tailwindcss/typography'
Cannot find module '@tailwindcss/aspect-ratio'
2:37:40 PM: web:build: node:internal/modules/cjs/loader:985
2:37:40 PM: web:build: const err = new Error(message);
2:37:40 PM: web:build: ^
2:37:40 PM: web:build:
2:37:40 PM: web:build: Error: Cannot find module '@tailwindcss/forms'
2:37:40 PM: web:build: Require stack:
2:37:40 PM: web:build: - /opt/build/repo/packages/config/tailwind-preset.js
2:37:40 PM: web:build: - /opt/build/repo/apps/marketing-site/tailwind.config.js
2:37:40 PM: web:build: - /opt/build/repo/node_modules/tailwindcss/lib/cli.js
2:37:40 PM: web:build: at Function.Module._resolveFilename (node:internal/modules/cjs/loader:985:15)
2:37:40 PM: web:build: at Function.Module._load (node:internal/modules/cjs/loader:833:27)
2:37:40 PM: web:build: at Module.require (node:internal/modules/cjs/loader:1057:19)
2:37:40 PM: web:build: at require (node:internal/modules/cjs/helpers:103:18)
2:37:40 PM: web:build: at Object.<anonymous> (/opt/build/repo/packages/config/tailwind-preset.js:88:5)
2:37:40 PM: web:build: at Module._compile (node:internal/modules/cjs/loader:1155:14)
2:37:40 PM: web:build: at Object.Module._extensions..js (node:internal/modules/cjs/loader:1209:10)
2:37:40 PM: web:build: at Module.load (node:internal/modules/cjs/loader:1033:32)
2:37:40 PM: web:build: at Function.Module._load (node:internal/modules/cjs/loader:868:12)
2:37:40 PM: web:build: at Module.require (node:internal/modules/cjs/loader:1057:19) {
2:37:40 PM: web:build: code: 'MODULE_NOT_FOUND',
2:37:40 PM: web:build: requireStack: [
2:37:40 PM: web:build: '/opt/build/repo/packages/config/tailwind-preset.js',
2:37:40 PM: web:build: '/opt/build/repo/apps/marketing-site/tailwind.config.js',
2:37:40 PM: web:build: '/opt/build/repo/node_modules/tailwindcss/lib/cli.js'
2:37:40 PM: web:build: ]
2:37:40 PM: web:build: }
2:37:40 PM: web:build: npm ERR! Lifecycle script `build:css` failed with error:
2:37:40 PM: web:build: npm ERR! Error: command failed
BTW, this is a monorepo project.
What I tried:
- adding those packages to the
nohoist
array in thepackage.json
file following these thread:https://github.com/tailwindlabs/tailwindcss-forms/issues/31
- moving those libraries from the
devDependencies
to thedependencies
array - updating the libraries to a newer version
I don’t know what else to do.
I’d appreciate any help!
Thanks!
Vero