Having a problem to publish my page #101515
-
Select Topic AreaGeneral BodyHi everyone, amerikailan.org Available Scripts npm start The page will reload when you make changes. npm test npm run build The build is minified and the filenames include the hashes. See the section about deployment for more information. npm run eject If you aren’t satisfied with the build tool and configuration choices, you can eject at any time. This command will remove the single build dependency from your project. Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. You don’t have to ever use eject. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. Learn More To learn React, check out the React documentation. Code Splitting Analyzing the Bundle Size Making a Progressive Web App Advanced Configuration Deployment npm run build fails to minify |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
|
This is React Website / App you need to do additional configuration to run it in GitHub pages. You can take idea from this sample code : Install GitHub Pages Package: Install the gh-pages package as a development dependency. npm install gh-pages --save-devUpdate package.json: Open package.json and add the following lines: "homepage": "https://your-username.github.io/your-repo-name",
Replace your-username and your-repo-name with your GitHub username and repository name.Add Deployment Scripts: Still in package.json, add the following scripts: "scripts": {
"predeploy": "npm run build",
"deploy": "gh-pages -d build",
}Deploy to GitHub Pages: Run the deployment script in your terminal: npm run deployCheck the Deployment: After the deployment script completes, you should see a new branch named gh-pages in your GitHub repository. Configure GitHub Pages in Repository Settings:
Now you can access you site on github url, if its visible then you can procced with adding custom domain. |
Beta Was this translation helpful? Give feedback.
-
|
Hey there! 👋 Thanks for posting in the GitHub Community, @nugrezo! We're happy you're here. You are more likely to get a useful response if you are posting your question in the applicable category. The Accessibility category is a place for our community to discuss and provide feedback on the digital accessibility of GitHub products. Digital accessibility means that GitHub tools, and technologies, are designed and developed so that people with disabilities can use them. I've gone ahead and moved this to the correct category for you. Good luck! |
Beta Was this translation helpful? Give feedback.
Thank you for your reply. I found the solution and finally I successfully published my page.
I’ve just changed my BrowserRouter to Hashrouter. Github does not support BrowserRouter. If the app has many routes which are wrapped by BrowserRoueter the github live page comes blank. The only thing we need to change it BrowserRouter to Hashrouter. That is it. I have been searching it for 2 days but finally I’ve solved. Posting this reply for the one who has the same problem.