mars / create-react-app-buildpack

⚛️ Heroku Buildpack for create-react-app: static hosting for React.js web apps
MIT License
3.28k stars 653 forks source link

Deployment fails without any specific error? #118

Closed MichalIrzylowski closed 6 years ago

MichalIrzylowski commented 6 years ago

Hey!

I have a deployment problem. I have set static.json. During the deployment it stops and says:

We're sorry this build is failing! You can troubleshoot common issues here:

But I don't know what the issue is :(

I have noticed

Exit code: 127

maybe it will help.

Deployment outupt:

Counting objects: 102, done. Delta compression using up to 4 threads. Compressing objects: 100% (100/100), done. Writing objects: 100% (102/102), 132.38 KiB | 3.58 MiB/s, done. Total 102 (delta 45), reused 0 (delta 0) remote: Compressing source files... done. remote: Building source: remote: remote: -----> React.js (create-react-app) multi app detected remote: -----> Configure create-react-app build environment remote: Using NODE_ENV=development remote: =====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-multi.git remote: =====> Detected Framework: Multipack remote: =====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-nodejs.git remote: =====> Detected Framework: Node.js remote: remote: -----> Creating runtime environment remote: remote: NPM_CONFIG_LOGLEVEL=error remote: NPM_CONFIG_PRODUCTION=false remote: NODE_VERBOSE=false remote: NODE_ENV=development remote: NODE_MODULES_CACHE=true remote: remote: -----> Installing binaries remote: engines.node (package.json): 10.1.0 remote: engines.npm (package.json): 5.6.0 remote: engines.yarn (package.json): unspecified (use default) remote: remote: Resolving node version 10.1.0... remote: Downloading and installing node 10.1.0... remote: npm 5.6.0 already installed with node remote: Resolving yarn version 1.x... remote: Downloading and installing yarn (1.9.4)... remote: Installed yarn 1.9.4 remote: remote: -----> Restoring cache remote: Skipping cache restore (not-found) remote: remote: -----> Building dependencies remote: Installing node modules (yarn.lock) remote: yarn install v1.9.4 remote: (node:310) ExperimentalWarning: The fs.promises API is experimental remote: [1/4] Resolving packages... remote: [2/4] Fetching packages... remote: (node:310) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. remote: info fsevents@1.2.4: The platform "linux" is incompatible with this module. remote: info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation. remote: [3/4] Linking dependencies... remote: warning " > bootstrap@4.1.2" has unmet peer dependency "jquery@1.9.1 - 3". remote: warning " > bootstrap@4.1.2" has unmet peer dependency "popper.js@^1.14.3". remote: [4/4] Building fresh packages... remote: error /tmp/build_7a83fd688f5485f4aa7c6e90ff423467/node_modules/node-base64: Command failed. remote: Exit code: 127 remote: Command: ./install.sh remote: Arguments: remote: Directory: /tmp/build_7a83fd688f5485f4aa7c6e90ff423467/node_modules/node-base64 remote: Output: remote: ./install.sh: 3: ./install.sh: node-waf: not found remote: info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. remote: remote: -----> Build failed remote: remote: We're sorry this build is failing! You can troubleshoot common issues here: remote: https://devcenter.heroku.com/articles/troubleshooting-node-deploys remote: remote: If you're stuck, please submit a ticket so we can help: remote: https://help.heroku.com/ remote: remote: Love, remote: Heroku remote: remote: ! Push rejected, failed to compile React.js (create-react-app) multi app. remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to swag-pictures. remote: To https://git.heroku.com/swag-pictures.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/swag-pictures.git'

Git repo to the app: https://github.com/MichalIrzylowski/swag-pictures

Can you help me somehow?

Thanks, Michał

mars commented 6 years ago

Hi @MichalIrzylowski 😁

The error causing the failure is output in the middle of that build log:

remote: error /tmp/build_7a83fd688f5485f4aa7c6e90ff423467/node_modules/node-base64: Command failed. remote: Exit code: 127 … remote: ./install.sh: 3: ./install.sh: node-waf: not found

Looks like that node-base64 package is the culprit. Checked the node-base64 npm listing and its last update was seven-years ago. It's very unlikely any npm package with a seven-year old native build step would still be working well today 🤪

Perhaps switch to use Node's built-in base64 capabilities or find a more recent base64 package. This one looks promising.

If the node-base64 package is a transitive dependency you don't directly control (i.e. it's a dependency of one of your app's dependencies), then you'll have to dig deeper with npm ls to figure out which of your dependencies requires it. Once you find the package that requires it, address the issue by upgrading that package or opening an issue on that project.

MichalIrzylowski commented 6 years ago

Thank you man! I found a package and deleted it (I installed it by an accident). Now everything is working! :) Thank you very much!