Search code examples
reactjsnext.jsipfs

Ipfs website renders differently on different gateways


So I have deployed a starter template on ipfs.

On this gateway the sites styles are not applied.

https://gateway.ipfs.io/ipfs/QmVeBe6GaarDRKKxLNJS672AHg98DYYouAxuby9P6qW1qg/

On this gateway the sites styles are applied.

https://bafybeidmp6t6chsfl74rf3o6xcjaosop2fo733klve6ji633t6ylbapcf4.ipfs.infura-ipfs.io/

What is the difference between these gateways, and how can one get consistent rendering on all gateways?


Solution

  • Some of your assets, stylesheets, and/or scripts are referenced by absolute paths which

    • breaks on path gateways (e.g., https://gateway.ipfs.io/ipfs/<cid>/path/to/resource)

    • but works on subdomain gateways (e.g., https://<cidv1b32>.ipfs.gateway.ipfs.io/path/to/resource)

    Your site works fine on other subdomain gateways too:

    See IPFS Public Gateway Checker for a list of them.