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/app.app-name
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/app.app-name/css/app.css:21927:3
at Root._error (/Users/me/PhpstormProjects/app.app-name/node_modules/postcss-minify-selectors/node_modules/postcss-selector-parser/dist/parser.js:137:24)
at Root.error (/Users/me/PhpstormProjects/app.app-name/node_modules/postcss-minify-selectors/node_modules/postcss-selector-parser/dist/selectors/root.js:43:25)
at Parser.error (/Users/me/PhpstormProjects/app.app-name/node_modules/postcss-minify-selectors/node_modules/postcss-selector-parser/dist/parser.js:392:25)
at Parser.expected (/Users/me/PhpstormProjects/app.app-name/node_modules/postcss-minify-selectors/node_modules/postcss-selector-parser/dist/parser.js:685:25)
at Parser.pseudo (/Users/me/PhpstormProjects/app.app-name/node_modules/postcss-minify-selectors/node_modules/postcss-selector-parser/dist/parser.js:500:25)
at Parser.parse (/Users/me/PhpstormProjects/app.app-name/node_modules/postcss-minify-selectors/node_modules/postcss-selector-parser/dist/parser.js:649:22)
at Parser.loop (/Users/me/PhpstormProjects/app.app-name/node_modules/postcss-minify-selectors/node_modules/postcss-selector-parser/dist/parser.js:618:18)
at new Parser (/Users/me/PhpstormProjects/app.app-name/node_modules/postcss-minify-selectors/node_modules/postcss-selector-parser/dist/parser.js:129:14)
at Processor._root (/Users/me/PhpstormProjects/app.app-name/node_modules/postcss-minify-selectors/node_modules/postcss-selector-parser/dist/processor.js:47:22)
at Processor._runSync (/Users/me/PhpstormProjects/app.app-name/node_modules/postcss-minify-selectors/node_modules/postcss-selector-parser/dist/processor.js:83:25)
at Processor.processSync (/Users/me/PhpstormProjects/app.app-name/node_modules/postcss-minify-selectors/node_modules/postcss-selector-parser/dist/processor.js:177:27)
at getParsed (/Users/me/PhpstormProjects/app.app-name/node_modules/postcss-minify-selectors/dist/index.js:34:59)
at /Users/me/PhpstormProjects/app.app-name/node_modules/postcss-minify-selectors/dist/index.js:196:39
at /Users/me/PhpstormProjects/app.app-name/node_modules/postcss/lib/container.js:239:18
at /Users/me/PhpstormProjects/app.app-name/node_modules/postcss/lib/container.js:135:18
at Rule.each (/Users/me/PhpstormProjects/app.app-name/node_modules/postcss/lib/container.js:101:16)
(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