In Preview, clicking on Code doesn't do anything
Opened this issue ยท 7 comments
./output/preview
ERROR: While running preview via local server, clicking on <>code tab in components or copying code doesn't work. Is it intended behaviour? currently, due to this - it feels same like finding element on tailwind website or local server and then check for same in vs-codep. can you suggest fix for this?
Suggestion: Also for novice out there, it would be great if you can suggest best practices and how crawler is helpful in local development. currently I'm using this via GitHub copilot to see if I can make improvement easily.
Thanks in advance :)
I hadn't used the local preview app in a while, but it looks like Tailwind changed how they structure the JavaScript, causing errors. If you look at the Developer Console, you'll see that the browser is returning CORS errors as it tries to access JS files externally from https://tailwindui.com (since the domain is hardcoded). It works fine running from their domain, just not localhost.
I was hoping I didn't have to process the internal <iframe srcDoc>
, but it appears that's the only way to fix this. Anyway, I'll take a look.
Thanks for quick response.
Also can you suggest best practice, suggestions using this repo? (e.g., How professional might get help from local previews? best way to use this inside VSCode? or maybe some Level 100 tips and tricks!!)
I hadn't used the local preview app in a while, but it looks like Tailwind changed how they structure the JavaScript, causing errors. If you look at the Developer Console, you'll see that the browser is returning CORS errors as it tries to access JS files externally from https://tailwindui.com (since the domain is hardcoded). It works fine running from their domain, just not localhost.
I was hoping I didn't have to process the internal
<iframe srcDoc>
, but it appears that's the only way to fix this. Anyway, I'll take a look.
I have the same problem, could you please update it, thank you very much!
Seems like they also remove old .css
and .js
files from their CDN every version now, hence older copies of my TailwindUI backups not working any more.
I've got a preliminary working version. It parses <iframe srcDoc>
to find all the external scripts and CSS resources, downloads them locally, and rewrites them as local references.
Still testing, but will publish once it's ready.
Hi, any news ? :D
Any news now? ;-)