laravel / sail

Docker files for running a basic Laravel application.
https://laravel.com/docs/sail
MIT License
1.67k stars 477 forks source link

UnexpectedValueException is thrown in fresh laravel project #499

Closed jedymatt closed 1 year ago

jedymatt commented 1 year ago

Description:

When I visit http://localhost on my newly created laravel project it shows this error:

Screenshot from 2022-11-23 19-50-35

It works fine if I'm using artisan serve command.

Steps To Reproduce:

  1. Create fresh project
    curl -s "https://laravel.build/blog?with=mysql" | bash
  2. Start sail
    sail up -d
  3. Open browser and visit http://localhost

I don't know the basics of changing permissions but I saw a answer in stackoverflow that uses this commands to resolve the issue:

https://stackoverflow.com/a/54070254/12620122

chmod -R gu+w storage

chmod -R guo+w storage

php artisan cache:clear

A comment from the answer's source also recommends a one line command instead of two

chmod -R a+w storage
github-actions[bot] commented 1 year ago

Thank you for reporting this issue!

As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub. If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.

Thank you!

driesvints commented 1 year ago

Would be cool if anyone on Ubuntu could confirm Sail is broken or not.

Random72IsTaken commented 1 year ago

Not sure if this helps, but projects are working fine in dev-containers. (via VSC)

curl -s "https://laravel.build/example-app?with=mysql,redis&devcontainer" | bash

Result: 2022-12-01_12-42

driesvints commented 1 year ago

Thank you @MinSulayman.

@jedymatt seems this is specific to your use case so please try a support channel:

Parry-97 commented 1 year ago

Would be cool if anyone on Ubuntu could confirm Sail is broken or not.

Hi guys...same issue here. Tried the laravel installer and curl -s "https://laravel.build/blog?with=mysql" | bash. As soon as I intend to start the containers with sail up. The same error occurs image