Bench build failed

$ bench build
yarn run v1.22.4
$ FRAPPE_ENV=production node rollup/build.js
Production mode
✔ Built js/moment-bundle.min.js
✔ Built js/libs.min.js
(node:2868) UnhandledPromiseRejectionWarning: Error: Cannot find module 'tailwindcss'
    at Function.Module._resolveFilename (module.js:548:15)
    at Function.Module._load (module.js:475:25)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at get_rollup_options_for_css (/home/frappe/frappe-bench/apps/frappe/rollup/config.js:120:5)
    at get_rollup_options (/home/frappe/frappe-bench/apps/frappe/rollup/config.js:32:10)
    at Object.keys.map.output_file (/home/frappe/frappe-bench/apps/frappe/rollup/config.js:187:5)
    at Array.map (<anonymous>)
    at get_options_for (/home/frappe/frappe-bench/apps/frappe/rollup/config.js:175:4)
    at build_assets (/home/frappe/frappe-bench/apps/frappe/rollup/build.js:52:18)
    at /home/frappe/frappe-bench/apps/frappe/rollup/build.js:43:30
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
    at Function.Module.runMain (module.js:696:11)
    at startup (bootstrap_node.js:204:16)
    at bootstrap_node.js:625:3
(node:2868) 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(). (rejection id: 1)
(node:2868) [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.
Done in 0.90s.

Getting the exact same error on develop. Have you resolved yours?

You need to run bench setup requirements

getting same error

Perhaps you have a Vue project https://stackoverflow.com/questions/58783426/cannot-find-module-tailwindcss

Hi there, it didn’t fix the problem just so you know :stuck_out_tongue_winking_eye: well but then I’m on Develop branch so I do expect all kinds of errors. Thank you anyway :slight_smile:

The original concept of promises was that you could have a rejected promise sitting around for some time before attaching a catch handler to it. For example, Firefox used to warn of uncaught rejection errors only when a rejected promise with no rejection handler was garbage collected from memory.

Somebody decided that JavaScript programmers couldn’t be trusted with managing promise rejections properly and changed the HTML spec to require browsers to throw “unhandled promise rejection” errors if a rejected promise has no rejection handlers added before code returns to the event loop.

On a case by case basis you can prevent the host being notified by adding a rejection handler that is never used. The reasoning is that adding a dummy rejection handler to a promise means that should it be rejected it has a rejection handler already - or if it was rejected the host is notified the promise now has a rejection handler - and you can call then and catch multiple times on the same promise.

A nice way to wait for several Promises to resolve to use the Promise.all function. It expects an Array of Promises, and produces a Promise that resolves to an Array containing the values that the individual Promises resolved to. Furthermore, it only resolves after the last Promise resolves. If any of its input Promises rejects, then the entire Promise.all expression rejects as well. It effectively “runs” all of its input processes “at the same time”, emulating the classic “fork-join” pattern.