frontend-monorepo
frontend-monorepo copied to clipboard
IPFS/Next.js build issue on trading
Description
- IPFS gateways work in two ways: subdomains and subfolders. Everything loads fine with subdomains, but the asset route is hardcoded to be
/which breaks when the app is served from/ipfs/qw.... - Next.js splits the app in to multiple bundles. On one deploy for some gateways, one of those bundles wasn't loading. While we haven't worked out why, it did make me realise that some of the bundles were quite chunky
Goal: Where currently it feels unreliable fetching console via IPFS, it should work more often than not
Tasks
- [ ] Ensure assets serve correctly on subfolder gateways
- [ ] Disable source maps in production builds? Reconfigure bundling? Unsure.
Example gateway links
- A subfolder based gateway: https://ipfs.fleek.co/ipfs/QmdoAFH9tTdyhqVGM6A9EcH6X1xh3cn9y2eMDmp9mYKeTC/
- A subdomain based gateway: https://console-fairground-wtf.ipns.dweb.link/
- A different IPFS based gateway: https://console-fairground-wtf.ipns.cf-ipfs.com/
- Set up
ipfs-desktopand try http://console-fairground-wtf.ipfs.localhost:8000 - Another quick test: Install Brave, visit https://console.fairground.wtf and click the IPFS link
#2353 used to be part of this ticket, but I split it out. Whoever picks that up may have relevant thoughts. Or not.
As part of this work its worth considering the potential build/ci changes that @dexturr will be working on. It might be simplest to solve this post build if there isn't a suitable way via nextjs tooling.