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

Suggestions how to implement this with DDEV? #79

Open
timothyoesch opened this issue Jan 7, 2024 · 3 comments
Open

Suggestions how to implement this with DDEV? #79

timothyoesch opened this issue Jan 7, 2024 · 3 comments

Comments

@timothyoesch
Copy link

timothyoesch commented Jan 7, 2024

Heyup!

Thanks for the plugin! Since I am working with ddev/ddev as my development environment, I was wondering if you have any suggestions to get it working there. I've tried to follow the instructions of this blogpost, sadly with no luck. Here's a reproduction repo: https://github.com/timothyoesch/ddev-vite-for-wp

Thanks for your help!

@brianjhanson
Copy link

It looks like your host value isn't quite right. You'll want that to be 0.0.0.0. That will tell Vite to broadcast to all available IP addresses.

@timothyoesch
Copy link
Author

Unfortunately, when using 0.0.0.0 as the host value, I get some puzzling CORS errors...

Access to script at 'https://0.0.0.0:5173/@vite/client' from origin 'https://ddev-vite-for-wp.ddev.site' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

GET https://0.0.0.0:5173/@vite/client net::ERR_FAILED 404 (Not Found)

Access to script at 'https://0.0.0.0:5173/js/src/main.js' from origin 'https://ddev-vite-for-wp.ddev.site' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

GET https://0.0.0.0:5173/js/src/main.js net::ERR_FAILED 404 (Not Found)

I know, CORS isn't actually an issue with this plugin and if it's requested, I will close the issue and try and figure it out myself. I'd be super glad for some assistance though. I have a working, yet very hacky and not so elegant solution for now. Would be amazing to get this working though!

@hiepvq
Copy link

hiepvq commented Feb 7, 2024

Different domain is blocked by cors of browser. You can use some browser extension to disable checking cors

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

3 participants