nystudio107 / craft-vite

Allows the use of the Vite.js next generation frontend tooling with Craft CMS
MIT License
51 stars 15 forks source link

Failed to connect to localhost port 3000 #74

Closed shifuma closed 1 year ago

shifuma commented 1 year ago

Question

I'm getting this error locally: cURL error 7: Failed to connect to localhost port 3000: Connection refused (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://localhost:3000/__vite_ping

It has no effect; I'm able to build assets without issue, but I'd like to fix it. Unfortunately, I am absolutely clueless when it comes to this sort of thing. I'm just using a standard DDEV setup, nothing special configured.

I'm guessing 'devServerInternal' => 'http://localhost:3000/', is incorrect, but how can I find out what it should be?

Thanks in advance!

shifuma commented 1 year ago

Oh...maybe it's just as simple as 'devServerInternal' => 'http://mysite.ddev.site:3000/', ... ?

khalwat commented 1 year ago

Did you check the docs for DDEV configuration?

https://nystudio107.com/docs/vite/#using-ddev

if so, probably you have not opened up port 3000 in ddev to be exposed to your local environment.

shifuma commented 12 months ago

Thanks for the reply. Yeah, everything matches those 'Using DDEV' docs.

jesuismaxime commented 7 months ago

Followed the documentation, double check with ddev's and I got that very same error. Any lead?

jesuismaxime commented 1 month ago

Just got that issue on a production website (that causes some trouble because of huuuuge logs files), simply turn useDevServer at false on non-local environments.