Trying to deploy my React app with gh-pages but got this error message : The "file" argument must be of type string. Received type undefined

Seems like a bug in gh-pages 2.1.

I solved mine by downgrading gh-pages to version 2.0:

yarn add [email protected] -D` // or

npm install -D [email protected]

Update: Fixed in [email protected]. You can now update your gh-pages package to latest version to fix this.

npm i gh-pages@latest

If you don't wish to downgrade to version 2.0.1, the workaround is to instead of using "deploy": "gh-pages -d build" as your deploy script, use:

"deploy": "gh-pages -d build --git git"

This somehow fixes the problem.

You can find the GitHub issue about this bug here: tschaub/gh-pages#308