简体   繁体   中英

Node app in Heroku: Module build failed: Error: Unexpected "space" found

I have a node app that has been live on Heroku for a year, but the last update is now crashing on build. I haven't seen this error before and can't find any help.

Here is the error log:

       yarn run v1.12.3
       $ react-scripts build
       Creating an optimized production build...
       Failed to compile.

       ./src/components/Admin_Navigation/navigation.css
       Module build failed: Error: Unexpected "space" found.


error Command failed with exit code 1.
       info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sonar@1.0.0 heroku-postbuild: `yarn build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the sonar@1.0.0 heroku-postbuild script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /tmp/npmcache.22xgq/_logs/2018-11-22T00_36_38_522Z-debug.log
-----> Build failed

       We're sorry this build is failing! You can troubleshoot common issues here:
       https://devcenter.heroku.com/articles/troubleshooting-node-deploys

       Some possible problems:

       - Dangerous semver range (>) in engines.node
         https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version

       Love,
       Heroku

 !     Push rejected, failed to compile Node.js app.
 !     Push failed

I've tried the following:

  1. Update Yarn Lock
  2. Update package.JSON
  3. Updated Yarn & Node versions

Any of your thoughts are appreciated. Thanks

Update: this is caused by an unnecessary space in CSS. You can manually look through the CSS for the space, or a less optimal solution is to roll back Node to a version that is less syntax-rigid.

I faced a similar problem to this, what helped me was to go line by line in searching for the problem, and in the end it was an unintended space between : and hover in the CSS file that was causing the problem.

It was surprising since that code I never changed and it was working before but the solution was to actually find the space being talked about in my CSS file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM