Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Github not connecting with the site on deployment #655

Open
theinit01 opened this issue Oct 15, 2023 · 2 comments
Open

Github not connecting with the site on deployment #655

theinit01 opened this issue Oct 15, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@theinit01
Copy link

Describe the bug

GitHub projects and profile picture isn't showing after deployment. It was working during development.

Steps to reproduce

  1. Go to https://theinit01.github.io/portfolio/#opensource
  2. 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

@rogigs
Copy link

rogigs commented Nov 18, 2023

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.

Screenshot 2023-11-18 151652

Screenshot 2023-11-18 151718

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

@Dereje1
Copy link

Dereje1 commented Jan 9, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants