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

In Preview, clicking on Code doesn't do anything #79

Open
everynoanysome opened this issue Jun 11, 2023 · 7 comments
Open

In Preview, clicking on Code doesn't do anything #79

everynoanysome opened this issue Jun 11, 2023 · 7 comments

Comments

@everynoanysome
Copy link

everynoanysome commented Jun 11, 2023

./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 :)

@kiliman
Copy link
Owner

kiliman commented Jun 12, 2023

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.

@everynoanysome
Copy link
Author

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!!)

@bill393
Copy link

bill393 commented Sep 15, 2023

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!

@VIEWVIEWVIEW
Copy link

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.

@kiliman
Copy link
Owner

kiliman commented Oct 16, 2023

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.

@MrJuliuss
Copy link

Hi, any news ? :D

@ag4u
Copy link

ag4u commented May 10, 2024

Any news now? ;-)

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

No branches or pull requests

6 participants