developerFolio
developerFolio copied to clipboard
Github not connecting with the site on deployment
Describe the bug
GitHub projects and profile picture isn't showing after deployment. It was working during development.
Steps to reproduce
- Go to https://theinit01.github.io/portfolio/#opensource
- Scroll down 3.. See error
Expected behavior
Github projects and contact me section should have been updated.
Is this responsiveness Issue
No
Screenshots
No response
Desktop
- OS: [e.g. iOS]
- Browser: [e.g. chrome, safari]
- Version: [e.g. 22]
Smartphones
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
Additional context
No response
I had the same problem. What happens is that when will deploy the application the archive profile.json is not the same path in development.
To fix in your machine:
import packageJson from "../../../package.json";
...
fetch(`${packageJson.homepage}/profile.json`)
This will work in production. In dev mode will need use the current solution.
Or you could remove too /portfolio
of your homepage in package.json
I recently encountered a similar issue. When I changed the homepage field in package.json to my own domain on gh-pages (instead of https://developerfolio.js.org/), the application would not work locally. Interestingly, removing the homepage field altogether seemed to resolve the issue locally. However, this is not a viable solution for build/production.
The issue, as @rogigs pointed out, seems to be that the application cannot access profile.json from the public folder while using fetch in the different components that require the profile data. This occurs when a domain other than the original is provided for the homepage field.
As a temporary workaround, I copied the file to the src folder as well, enabling direct access from the components. You can see the changes I made in this commit.
While this solution works for now, itβs not ideal. If anyone has a more permanent fix, it would be greatly appreciated.