nft-gallery icon indicating copy to clipboard operation
nft-gallery copied to clipboard

Code Checker showing koda page on preview

Open prury opened this issue 1 year ago • 11 comments

image

from @daiagi:

image

prury avatar Feb 22 '24 17:02 prury

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

kodabot avatar Feb 22 '24 17:02 kodabot

@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?

daiagi avatar Feb 22 '24 22:02 daiagi

ASSIGNMENT EXPIRED - @daiagi has been unassigned.

kodabot avatar Feb 24 '24 05:02 kodabot

one more artist image

-> p2

exezbcz avatar Feb 24 '24 19:02 exezbcz

@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

daiagi avatar Feb 24 '24 21:02 daiagi

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

vikiival avatar Feb 24 '24 22:02 vikiival

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

preschian avatar Feb 24 '24 22:02 preschian

@preschian Intresting idea, worth a shot

daiagi avatar Feb 24 '24 22:02 daiagi

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

yangwao avatar Feb 25 '24 01:02 yangwao

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

This one works

daiagi avatar Feb 25 '24 03:02 daiagi

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 avatar Feb 26 '24 11:02 daiagi

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

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

daiagi avatar Mar 03 '24 11:03 daiagi

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 avatar Mar 04 '24 03:03 preschian

should works now

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

preschian avatar Mar 04 '24 03:03 preschian