Npm run build-prod hangs with warnings, while build-dev works

Hi there!

I just tried to build a production build for my app (web-app for now) and the production build is unable to finish. Here’s the output for npm run build-prod:

[email protected] build-prod /Users/me/PhpstormProjects/
cross-env NODE_ENV=production node ./build/build.js

⠇ building for production…(node:86035) UnhandledPromiseRejectionWarning: Error: Expected a pseudo-class or pseudo-element.
at /Users/me/PhpstormProjects/
at Root._error (/Users/me/PhpstormProjects/
at Root.error (/Users/me/PhpstormProjects/
at Parser.error (/Users/me/PhpstormProjects/
at Parser.expected (/Users/me/PhpstormProjects/
at Parser.pseudo (/Users/me/PhpstormProjects/
at Parser.parse (/Users/me/PhpstormProjects/
at Parser.loop (/Users/me/PhpstormProjects/
at new Parser (/Users/me/PhpstormProjects/
at Processor._root (/Users/me/PhpstormProjects/
at Processor._runSync (/Users/me/PhpstormProjects/
at Processor.processSync (/Users/me/PhpstormProjects/
at getParsed (/Users/me/PhpstormProjects/
at /Users/me/PhpstormProjects/
at /Users/me/PhpstormProjects/
at /Users/me/PhpstormProjects/
at Rule.each (/Users/me/PhpstormProjects/
(node:86035) 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:86035) [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.
⠴ building for production…

It just hangs there. When I check htop the system sits idle while node.js keeps running.

npm run build-dev works fine. This happens on both MacOS and Ubuntu. I’ve ran npm update as well but no avail.

Any idea what could be the cause of this?

Thanks for the amazing framework! It’s been a treat to work with :slight_smile:

Found the solution myself. It wasn’t because of F7, but related to. I had a variables.scss file where I would override all the F7 css variables. However, that syntax doesn’t fly with the production compiler.

Would be nice to have proper SCSS css files in the future. But glad I tracked down the problem. If anyone else is using Sass + F7 - look at the syntax :slight_smile:

What did work was to put that CSS into a regular .css file and @import that from the .scss file. Not ideal, and it doesn’t allow for variables, obviously - but it works and no longer trips up npm run build-prod!

1 Like