Skip to content

Error while using Inertia Vue: The Vite server should not be accessed directly. #96

@Bosphoramus

Description

@Bosphoramus
  • Laravel Vite Plugin Version: 0.5.0
  • Laravel Version: 9.21.0
  • Node Version: 16.15.0
  • NPM Version: 8.14.0
  • Host operating system: macOS 12.4
  • Web Browser & Version: Chrome 103
  • Running in Sail / Docker: No

Description:

I have scaffolded an Inertia Vue SSR application using Laravel breeze with the following breeze command:

php artisan breeze:install vue --ssr

Everything works correctly but there is a little bug that bothers me, almost all the time, when i start the dev server i get the following warning in the console: The Vite server should not be accessed directly. Your Laravel application's configured APP_URL is: X

Im not accessing the vite dev server url, im using Laravel Valet and im accessing the "fancy" vhost url.

Steps To Reproduce:

Install Laravel and enter the directory:

laravel new test && cd test

Require Breeze

composer require laravel/breeze

Scaffold a Breeze Inertia Vue SSR app using

php artisan breeze:install vue --ssr

Run the dev server

npm install && npm run dev

Go to your app

Using your web browser navigate to your app, usually the APP_URL that the dev server suggests

Stop the dev server

WITHOUT CLOSING YOUR APP TAB ON YOUR BROWSER Ctrl + c on the console, to close the dev server

Start it again

npm run dev

Now you should be seeing the warning, which shouldnt be showing because the user never accesed the dev server URL directly

Just noticed this also happens scaffolding the Breeze Vue Inertia application without SSR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions