Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Receive error when deploy to GitHub pages

I'm deploy react app to git hub pages and receive error. File sizes after gzip:

68.67 KB  build\static\js\2.c2c334ae.chunk.js
 2.98 KB  build\static\js\main.8a72b1a2.chunk.js
  774 B   build\static\js\runtime~main.8f8a00a4.js

The project was built assuming it is hosted at /sort-customers-list/. You can control this with the homepage field in your package.json.

The build folder is ready to be deployed. To publish it at https://sejob.github.io/sort-customers-list, run: npm run deploy

Find out more about deployment here:

[email protected] deploy 
C:\Users\SeJo\Documents\Code\DEV_HW\sort-customers-list
gh-pages -d build

The "file" argument must be of type string. Received type undefined

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] deploy: `gh-pages -d build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] deploy 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!    
C:\Users\SeJo\AppData\Roaming\npm-cache\_logs\2019-08-01T12_09_52_445Z-debug.log
like image 678
Sergey Bekker Avatar asked Aug 01 '19 12:08

Sergey Bekker


People also ask

What should be careful of before deploying to GitHub Pages?

Even if the repository is private, the site is still publicly available on the internet — so the developer should always check for any sensitive data before deployment. Naturally, sending sensitive data (e.g. passwords or credit card information) is also unsafe.

Why my GitHub Pages is not working?

Solution: Verify the publishing source and published URL from your repository's settings tab. Double check that you are using the correct URL by visiting your repository's Settings, and scrolling down to the GitHub Pages section. You should see the URL where your site is published.

Is there a size limit to GitHub Pages?

Published GitHub Pages sites may be no larger than 1 GB. GitHub Pages sites have a soft bandwidth limit of 100 GB per month.


3 Answers

The problem occurs in the new version of GitHub pages. Just use this command to install the previous version of GitHub pages:

npm install [email protected]

Hope it will help!

like image 157
Ismail Ramzan Avatar answered Oct 17 '22 14:10

Ismail Ramzan


I also had this same problem on a fresh install of create-react-app. I have no idea what the problem was, but I did the following:

  1. Downgrade gh-pages from 2.1.0 to 2.0.1
  2. Instead of running npm run deploy, manually run npm run build then gh-pages -d build from the commandline.

At first, I'd get the same error in the commandline, even after checking that the version was downgraded to 2.0.1, but for some reason it worked after manually creating the gh-pages branch and pushing some files into it. As of now, npm run deploy throws the error but at least gh-pages -d build from the console works.

like image 30
user11869607 Avatar answered Oct 17 '22 15:10

user11869607


INSTALL/REINSTALL GIT Update NPM Reopen EDITOR

this solved my problem

like image 1
SystemX Avatar answered Oct 17 '22 14:10

SystemX