I have an error that happens infrequently. After using my website where I fetch data from IPFS for a while and I refresh the page the fetch that’s initiated will stall and never retrieve the data and won’t retrieve the data no matter how many times I refresh unless I close out of the browser and relaunch it.
here is how I have my client set up:
import { create } from ‘ipfs-http-client’;
const auth = 'Basic ’ + Buffer.from(process.env.NEXT_PUBLIC_INFURA_PROJECTID + ‘:’ + process.env.NEXT_PUBLIC_INFURA_IPFS).toString(‘base64’);
const ipfs = create({
host: ‘ipfs.infura.io’,
port: 5001,
protocol: ‘https’,
apiPath: ‘/api/v0’,
headers: {
authorization: auth,
},
});
export default ipfs;