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

Israel Peck

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! [email protected] heroku-postbuild: `yarn build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] 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.

Aklank Jain

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.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Vue-Router error: "Module build failed: SyntaxError: Unexpected token"

From Dev

Heroku app module not found error with pickle module in python I believe

From Dev

Webpack error after upgrading Node: "Module parse failed: Unexpected token"

From Dev

Module build failed: Error: Cannot find module 'node-sass'

From Dev

React app Heroku build failed - git push heroku master - Expecting X, Parse error on line 1: got unexpected end of input. Line 1 of which file?

From Dev

./node_modules/node-pty/build/Release/pty.node Module parse failed: Unexpected character ''

From Dev

Seeing error Module not found: 'pg-native' in heroku app

From Dev

How to fix 'failed to compile Node.js app' error on heroku

From Dev

Deploy ReactJS/node.js Express app to Heroku : not found error

From Dev

Module build failed: SyntaxError: Unexpected token

From Dev

Module build failed: SyntaxError: Unexpected token, expected ,

From Dev

ERROR in ./src/app.js Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Cannot find module '@babel/preset-present-env'

From Dev

Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'build\app' imported from build\server.js

From Dev

ERROR in ./src/styles.scss .. Module build failed: Error: Cannot find module 'node-sass'

From Dev

Heroku - Node.js - React App - Build failed - "Cannot find file"

From Dev

Webpack module build failed unexpected token (rails react build)

From Dev

Module parse failed: Unexpected token (14:6) while heroku deployment

From Dev

Xcode Build failed,fatal error: module 'firebase_auth' not found @import firebase_auth;

From Dev

Visual Studio App Center Error: Publishing build artifacts failed with an error: Not found PathtoPublish

From Dev

Module not found Error when deployed on Heroku

From Dev

Module not found: error when deployed on Heroku

From Dev

Failed to execute 'npm run dist' at command (node build/build-plugins.js) loader.js:775 MODULE_NOT_FOUND

From Dev

Using a Node module in a Django / Python app on Heroku

From Dev

Typescript React / NestJS app fails @Heroku build - "error TS2307: Cannot find module"

From Dev

ReactJS - Module build failed: SyntaxError: Unexpected token react components not rendering

From Javascript

ReactJS Module build failed: SyntaxError: Unexpected token - ReactDOM.render

From Dev

Module build failed: SyntaxError: Unexpected token (11:16)

From Dev

Webpack, React JSX, Babel: Module build failed, "unexpected token" empty?

From Java

Failed to set up SDK: Error:Module 'app': platform 'Google Inc.:Google APIs:21' not found

Related Related

  1. 1

    Vue-Router error: "Module build failed: SyntaxError: Unexpected token"

  2. 2

    Heroku app module not found error with pickle module in python I believe

  3. 3

    Webpack error after upgrading Node: "Module parse failed: Unexpected token"

  4. 4

    Module build failed: Error: Cannot find module 'node-sass'

  5. 5

    React app Heroku build failed - git push heroku master - Expecting X, Parse error on line 1: got unexpected end of input. Line 1 of which file?

  6. 6

    ./node_modules/node-pty/build/Release/pty.node Module parse failed: Unexpected character ''

  7. 7

    Seeing error Module not found: 'pg-native' in heroku app

  8. 8

    How to fix 'failed to compile Node.js app' error on heroku

  9. 9

    Deploy ReactJS/node.js Express app to Heroku : not found error

  10. 10

    Module build failed: SyntaxError: Unexpected token

  11. 11

    Module build failed: SyntaxError: Unexpected token, expected ,

  12. 12

    ERROR in ./src/app.js Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Cannot find module '@babel/preset-present-env'

  13. 13

    Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'build\app' imported from build\server.js

  14. 14

    ERROR in ./src/styles.scss .. Module build failed: Error: Cannot find module 'node-sass'

  15. 15

    Heroku - Node.js - React App - Build failed - "Cannot find file"

  16. 16

    Webpack module build failed unexpected token (rails react build)

  17. 17

    Module parse failed: Unexpected token (14:6) while heroku deployment

  18. 18

    Xcode Build failed,fatal error: module 'firebase_auth' not found @import firebase_auth;

  19. 19

    Visual Studio App Center Error: Publishing build artifacts failed with an error: Not found PathtoPublish

  20. 20

    Module not found Error when deployed on Heroku

  21. 21

    Module not found: error when deployed on Heroku

  22. 22

    Failed to execute 'npm run dist' at command (node build/build-plugins.js) loader.js:775 MODULE_NOT_FOUND

  23. 23

    Using a Node module in a Django / Python app on Heroku

  24. 24

    Typescript React / NestJS app fails @Heroku build - "error TS2307: Cannot find module"

  25. 25

    ReactJS - Module build failed: SyntaxError: Unexpected token react components not rendering

  26. 26

    ReactJS Module build failed: SyntaxError: Unexpected token - ReactDOM.render

  27. 27

    Module build failed: SyntaxError: Unexpected token (11:16)

  28. 28

    Webpack, React JSX, Babel: Module build failed, "unexpected token" empty?

  29. 29

    Failed to set up SDK: Error:Module 'app': platform 'Google Inc.:Google APIs:21' not found

HotTag

Archive