Skip to content

Connection Issues on GitHub Codespaces #16448

@Planasoft-Lorenz

Description

@Planasoft-Lorenz

Describe the bug

I'm developing locally with Inertia.js, Vue.js, and Laravel without any issues. However, when I use my repository in GitHub Codespaces, I encounter "ERR_CONNECTION_REFUSED" errors. My local development environment is started with npm run dev and php artisan serve, where the former runs on port 5173 and the latter on port 8000. In Codespaces, however, resources under these ports cannot be loaded (console error messages for app.js, client, and Home.vue). How can I properly configure these ports in GitHub Codespaces, or is there another recommended approach to resolve these connection issues?

Reproduction

https://www.vite.new

Steps to reproduce

Install Laravel with Inertia.js and vue and run "npm run dev" and "php artisan serve". Open the website in browser.

System Info

Github Codespaces

Used Package Manager

npm

Logs

When I run npm run dev, I receive the following console output:

VITE v5.2.8 ready in 265 ms

➜ Local: http://localhost:5173/
➜ Network: use --host to expose
➜ press h + enter to show help

LARAVEL v11.3.1 plugin v1.0.2

➜ APP_URL: http://localhost

When I run php artisan serve, I receive the following console output:

INFO Server running on [http://127.0.0.1:8000].

Upon accessing the website using the URL generated by php artisan serve, I receive the following error messages in the developer console:

client:1
Failed to load resource: net::ERR_CONNECTION_REFUSED
app.js:1
Failed to load resource: net::ERR_CONNECTION_REFUSED
Home.vue:1
Failed to load resource: net::ERR_CONNECTION_REFUSED

According to the Network tab, the following request URLs were used:

  • http://[::1]:5173/@vite/client
  • http://[::1]:5173/resources/js/app.js
  • http://[::1]:5173/resources/js/Pages/Home.vue

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions