laravel / framework

The Laravel Framework.
https://laravel.com
MIT License
32.23k stars 10.92k forks source link

Exception Folder is not being copied using Composer #21663

Closed vistiyos closed 6 years ago

vistiyos commented 6 years ago

Description:

I'm working on a project using Laravel 5.5.14 and I'm having a weird issue with Symfony HttpKernel component. Composer does not download or extract the Exception folder of the library so anytime that the application tries to thrown an Exception I get "Class 'Symfony\Component\HttpKernel\Exception\XYZException' not found".

I've tried different things:

None of the above solutions worked. I'm kind of desperate because I don't have a clue about this. Any light on this will be highly appreciate.

Steps To Reproduce:

This is how my composer.json looks like:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=7.0.0",
        "barryvdh/laravel-ide-helper": "^2.4",
        "dingo/api": "2.0.0-alpha1",
        "doctrine/dbal": "^2.6",
        "fideloper/proxy": "~3.3",
        "laracademy/interactive-make": "^1.1",
        "laravel/framework": "5.5.*",
        "laravel/tinker": "~1.0",
        "symfony/http-kernel": "^3.3",
        "tcg/voyager": "^1.0",
        "tymon/jwt-auth": "dev-develop"
    },
    "require-dev": {
        "barryvdh/laravel-debugbar": "^3.1",
        "filp/whoops": "~2.0",
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~6.0"
    },
    "autoload": {
        "classmap": [
            "database/seeds",
            "database/factories"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "scripts": {
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate"
        ],
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "php artisan ide-helper:generate",
            "php artisan ide-helper:meta",
            "@php artisan package:discover"
        ]
    },
    "config": {
        "preferred-install": "dist",
        "sort-packages": true,
        "optimize-autoloader": true
    },
    "repositories": {
        "hooks": {
            "type": "composer",
            "url": "https://larapack.io"
        }
    }
}

I'm also using Homestead Vagrant Box 3.1.0

sisve commented 6 years ago

Why are you asking us and not the Symfony project? What makes you think this is a Laravel issue? Also, there is no Symfony\Component\HttpKernel\Exception\XYZException in https://github.com/symfony/http-kernel/tree/3.3/Exception

Dylan-DPC-zz commented 6 years ago

The error could be caused by some package this is using. This isn't a laravel bug and can be closed.

MrMatsumoto commented 6 years ago

@vistiyos : I had the same problem and i found the reason. I'm using mac with vagrant and nfs shared folders. Since High Sierra nfs support with vagrant is buggy and the filesystem inside vagrant shows files and folders twice or "eat them up". Thats why the Exception folder is missing.

https://github.com/hashicorp/vagrant/issues/8788

I could solve it by using this mount options for nfs synced folders:

mount_options: ['nolock', 'vers=3', 'tcp', 'fsc', 'actimeo=1', 'rw']

vistiyos commented 6 years ago

@MrMatsumoto thank you! Where should I put the mount_options section?

MrMatsumoto commented 6 years ago

@vistiyos : The synced folders are defined in your Vagrantfile. There you can adjust the mount options.

e.g.

config.vm.synced_folder ".", "/vagrant", type: "nfs", mount_options: ['nolock', 'vers=3', 'tcp', 'fsc', 'actimeo=1', 'rw']
jltxwesley commented 6 years ago

I had the same issue, for some reasons, the whole Exception folder is not installed under http-kernel.

@sisve why people cannot ask opinions here? Does Laravel 5.5 use Symfony http-kernel 3.3 package? BTW, 'XYZException' means 'HttpException', 'NotFoundHttpException' etc... it doesn't mean 'XYZException' Class!!!

@MrMatsumoto Thanks, you saved my day, it works perfectly. For anyone has the same issue and use homestead, add the mount_options to Homestead.yaml and reload the homestead.

nomadme commented 6 years ago

I can confirm this issue on Laravel Framework 5.4.36

@MrMatsumoto Confirmed fixing the missing Exception folder.

seanmangar commented 6 years ago

Had the same issue, fixing it by not using nfs anymore

martinbean commented 6 years ago

Having this same issue, but pretty sure I experienced it before upgrading to High Sierra, too.

Can someone explain what each of these mount options do?

['nolock', 'vers=3', 'tcp', 'fsc', 'actimeo=1', 'rw']

Dylan-DPC-zz commented 6 years ago

I would suggest if you need any help on this to try the forums or the slack channel.

martinbean commented 6 years ago

@Dylan-DPC Thanks, but I was just after a simple description of each of the above mount options. Copying them to my Vagrantfile has fixed the issue, but I’d rather know why it’s fixed it.

devcircus commented 6 years ago

More of a homestead question, maybe vagrant. I would say it's definitely not a bug in the framework itself. Maybe @svpernova09 has some insight.

svpernova09 commented 6 years ago

NFS on High Sierra is currently bugged. Will require a MacOS update to fix. Reportedly it has been fixed in Beta 3, but AFAIK at the time of this comment it hasn't been pushed to the public.

If you're using NFS on High Sierra at the moment, all bets are off on if anything at all is going to work. Unfortunately this is a MacOS issue.