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

adapter-static does not behave properly when served from IPFS #638

Closed
wighawag opened this issue Mar 24, 2021 · 2 comments
Closed

adapter-static does not behave properly when served from IPFS #638

wighawag opened this issue Mar 24, 2021 · 2 comments

Comments

@wighawag
Copy link
Contributor

Describe the bug
The bug is best exemplified with this sample app : https://github.com/wighawag/svelte-kit-ipfs-example

It is the basic sveltekit app modified to use static-adapter and it comes bundled with a static server that behave like ipfs gateways
In such case, the base path cannot be known at build time as the base path is composed of the ipfs hash of the content

if you load the page with an url like http://localhost:8080/ipfs/ffff/ the css is not taken in consideration

To Reproduce
See repo : https://github.com/wighawag/svelte-kit-ipfs-example

Expected behavior
Svelte Kit adapter-static should work well on host where the basepath cannot be predicted. The resulting build should remain independent of the path where it is served

Severity
As I build website solely on ipfs, this is a blocking feature.

Example of svelte based website (which use snowpack) that works on IPFS with root base path and hashed base path
root: https://bafybeiailrpnrx5qaeegtpeysazfsvutwatwcsvkyx54u3fxvedv34mhru.ipfs.cf-ipfs.com/
path with hash: https://dweb.link/ipfs/bafybeiailrpnrx5qaeegtpeysazfsvutwatwcsvkyx54u3fxvedv34mhru or https://ipfs.io/ipfs/bafybeiailrpnrx5qaeegtpeysazfsvutwatwcsvkyx54u3fxvedv34mhru/
It also available on ENS via : https://mandalas.eth.link/

@benmccann benmccann changed the title svelte kit adapater-static do not behave properly when served from IPFS adapter-static does not behave properly when served from IPFS Mar 24, 2021
@antony
Copy link
Member

antony commented Mar 24, 2021

There's an open issue for making the base path dynamic, #595 which would probably resolve this.

@Rich-Harris
Copy link
Member

closing this as it's covered by #595

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants