kodadot / nft-gallery

Generative Art Marketplace
https://koda.art
MIT License
640 stars 362 forks source link

Code Checker showing koda page on preview #9526

Closed prury closed 8 months ago

prury commented 8 months ago

image

from @daiagi:

image

kodabot commented 8 months ago

ASSIGNED - @daiagi 🔒 LOCKED -> Saturday, February 24th 2024, 05:28:46 UTC -> 36 hours

daiagi commented 8 months ago

@kodadot/internal-dev not quite sure what's going on here the iframe src is sandbox.html?hash=<hash> where sandbox.html is in public folder

this worked fine in local machine, and in pr preview environment, but when deployed, since sandbox is not in pages dir, it is interpreted as wrong route and navigates back to home page.

navigating to other static assets however, works for example https://canary.kodadot.xyz/robots.txt works

I'm guessing it is something to do with netlify since it does work here

@Jarsen136 @preschian wdyt?

kodabot commented 8 months ago

ASSIGNMENT EXPIRED - @daiagi has been unassigned.

exezbcz commented 8 months ago

one more artist

image

-> p2

daiagi commented 8 months ago

@vikiival maybe any idea? I'm guessing something to do with netlify routing rules

Not a lot I can try since it works In local and preview environments

vikiival commented 8 months ago

AFAIK: prod is built on cf and previews on netlify. Is there some difference in config ? Cc @preschian @yangwao

preschian commented 8 months ago

Another workaround, upload sandbox.html to ipfs, serve iframe to that ipfs

daiagi commented 8 months ago

@preschian Intresting idea, worth a shot

yangwao commented 8 months ago

what about this one? https://canary-netlify.kodadot.xyz/code-checker

daiagi commented 8 months ago

what about this one? https://canary-netlify.kodadot.xyz/code-checker

This one works

daiagi commented 8 months ago

Another workaround, upload sandbox.html to ipfs, serve iframe to that ipfs

tried. it doesn't work when passing hash url param

this works: https://ipfs.io/ipfs/bafkreicb3rwp6v2v66ct7w5xwqmvw3v5hu2hij6h6tx4qji6el5k7ovkhm

this doesn't

https://ipfs.io/ipfs/bafkreicb3rwp6v2v66ct7w5xwqmvw3v5hu2hij6h6tx4qji6el5k7ovkhm?hash=0x0456545c32beeb2f0e0a2f6936e4a448a2abf60377ce5a5664dfa5479ecc5

daiagi commented 8 months ago

what about this one? https://canary-netlify.kodadot.xyz/code-checker

@preschian could you look into why it doesn't work on cf?

preschian commented 8 months ago

could you look into why it doesn't work on cf?

another workaround https://github.com/kodadot/workers/pull/258

I think the limitation is from nitro. I just tested the nuxt3 starter, and it doesn't work on cf-pages

preschian commented 8 months ago

should works now

https://kodadot.xyz/sandbox.html?hash=0x4bcdb62eba28b18e8cab70cd4252c749eb969d4555c91adec866775ef59db13f