-
Notifications
You must be signed in to change notification settings - Fork 37
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
images not rendering until browser page refresh #14
Comments
I’m on my phone so I can’t see the screencast now. I will check it out tomorrow but feel free to keep pinging me if I don’t answer. |
This is the site with public pushed to netlify - working as expected This is the site with public uploaded to pinata (as of today they support folders) - images not loading without a browser refresh and at that the home page isn't getting past the blur effect https://gateway.pinata.cloud/ipfs/QmTHu1eMe9shezggrdS8oqbSppYWfQ8jfSpVGzpkHk2Ktj/ Here's a fork of the starter that include the ipfs plugin |
It seems that the problem lies in the handling of page data JSON files. Here's an excerpt from the top page's page data: "cover": {
"children": [
{
"__typename": "ImageSharp",
"fluid": {
/* ... */
"src": "../../../static/40d4f4de1973c24726e4ef65ef5fd03e/97e83/photo-1507915600431-5292809c5ab7.jpg",
/* ... */
}
}
]
} The value of However, afaik it's not trivial to guess the base URL for each page data file. To make matters worse, there might not be a single consistent URL. For example, if a user is navigating between pages quickly, relative URLs could be resolved with an incorrect base URL unless the updates of the current URL are perfectly synchronized with the initiation of requests for page assets. A possible solution is to not patch the page data during build, but instead to patch it on a client-side where the actual value of // hypothetical utility function
import {resolveUrls} from 'gatsby-plugin-ipfs'
export default function Template({ data }) {
const dataPatched = React.useMemo(() => resolveUrls(data), [data]);
/* ... */
} |
I'm also having this issue! I was so close to getting my gatsby blog working with IPFS |
When public folder is put into ipfs the images don't render on the first page load. Seems that they only appear after a browser/page refresh.
Here's a screencast of the behavior. Not sure how to better describe this behavior. Does this happen to you @satazor? Not sure if this is a local to my ipfs node or not. I haven't yet found a pinner that I can test this on.
https://screencast.com/t/Xhw7MZxsJ . <-- requires flash, I know. I know. Sorry
The text was updated successfully, but these errors were encountered: