pyscript / pyscript

PyScript is an open source platform for Python in the browser. Try PyScript: https://pyscript.com Examples: https://tinyurl.com/pyscript-examples Community: https://discord.gg/HxvBtukrg2
https://pyscript.net/
Apache License 2.0
17.97k stars 1.44k forks source link

[BUG] examples not loading #277

Closed prasun3 closed 2 years ago

prasun3 commented 2 years ago

Describe the bug

I am trying to see the examples but I am unable to do so. I downloaded the repo and opened the examples in Chrome, but the examples didn't work. For example this is what antigravity.html rendered.

- paths: - ./antigravity.py Based on xkcd: antigravity https://xkcd.com/353/. import antigravity antigravity.fly()

I think this is because the examples refer to ../build/pyscript.{css,js} which is not present in the repo. I created the folder and downloaded `pyscript.{css,js}' and reloaded the page but saw the following error in the browser.

Access to fetch at 'file:///C:/path/to/pyscript/pyscript-main/pyscriptjs/examples/antigravity.py' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.

To Reproduce Download repo and open in Chrome

Expected behavior See examples in action.

Screenshots None

Additional context None

marcbernot commented 2 years ago

See explanation and workaround there #257.

antocuni commented 2 years ago

Duplicate of #257