Home > Software design >  UnhandledPromiseRejectionWarning: Error: Cannot find module 'tailwindcss' heroku error
UnhandledPromiseRejectionWarning: Error: Cannot find module 'tailwindcss' heroku error

Time:10-31

I'm getting this error when building a react project with:

"devDependencies": {
"@iconify/react": "^3.0.1",
"autoprefixer": "^9.8.6",
"postcss": "^7.0.36",
"tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.2.7",
}

this heroku error has come to deploy project.

(node:2968) UnhandledPromiseRejectionWarning: Error: Cannot find module 'tailwindcss'

Require stack:

/tmp/build_a33bf7e6/frontend/craco.config.js

/tmp/build_a33bf7e6/frontend/node_modules/@craco/craco/lib/config.js

/tmp/build_a33bf7e6/frontend/node_modules/@craco/craco/scripts/build.js

at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)

at Function.Module._load (internal/modules/cjs/loader.js:746:27)

at Module.require (internal/modules/cjs/loader.js:974:19)

at require (internal/modules/cjs/helpers.js:93:18)

at Object. (/tmp/build_a33bf7e6/frontend/craco.config.js:5:23)

at Module._compile (internal/modules/cjs/loader.js:1085:14)

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)

at Module.load (internal/modules/cjs/loader.js:950:32)

at Function.Module._load (internal/modules/cjs/loader.js:790:12)

at Module.require (internal/modules/cjs/loader.js:974:19)

(Use node --trace-warnings ... to show where the warning was created)

(node:2968) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)

(node:2968) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

CodePudding user response:

Replace below line from devDependencies. "tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.2.7", with "@tailwindcss/postcss7-compat": "^2.2.7",

CodePudding user response:

Adding to Vishwas's answer (that help me a lot on BitBucket) also you should use environment variable CI = false for build

  • Related