Categories

See More
Popular Forum

MBA (4887) B.Tech (1769) Engineering (1486) Class 12 (1030) Study Abroad (1004) Computer Science and Engineering (988) Business Management Studies (865) BBA (846) Diploma (746) CAT (651) B.Com (648) B.Sc (643) JEE Mains (618) Mechanical Engineering (574) Exam (525) India (462) Career (452) All Time Q&A (439) Mass Communication (427) BCA (417) Science (384) Computers & IT (Non-Engg) (383) Medicine & Health Sciences (381) Hotel Management (373) Civil Engineering (353) MCA (349) Tuteehub Top Questions (348) Distance (340) Colleges in India (334)
See More

gh-pages not loading bundle.js from index.html

General Tech Bugs & Fixes
Max. 2000 characters
Replies

usr_profile.png
Charles Kyobe

User

( 8 months ago )

 

I have set up a React project with webpack.I want to upload this project on my user site on Github. I created the user site repository with 2 branches- master and gh-pages. The project structure is as follows:

 dist
    index.html
    bundle.js
 index.html

The Package.json file has the following commands for build and deployment.

 "start": "webpack-dev-server --open --mode development --content-base ./dist",
 "test": "npm run lint && npm run security-check && npm run bundle",
 "predeploy": "npm run build",
 "deploy": "gh-pages -d dist"

In dev mode, the project is working fine.The HtmlWebPackPlugin is inserting the bundle js script tag in the dist/index.html. For deploying to gh-pages, when I run the deploy command, the code is updated correctly in the branch gh-pages. I can see the latest dist folder files in there.

But the user site is giving me 404: not found error for bundle.js.

what's your interest


forum_ban8_5d8c5fd7cf6f7.gif