Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

GregersBoye's avatar

Problems after updating composer-packages

Hi all I updated my composer-packages, and after that, my production-environment fails when trying to access the site. The funny thing is, it works fine in dev (under docker).

The exception I get is as follows: local.ERROR: Argument 1 passed to Symfony\Component\HttpFoundation\InputBag::get() must be of the type string, null given, called in /var/www/yoursite/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php on line 160 {"exception":"[object] (TypeError(code: 0): Argument 1 passed to Symfony\Component\HttpFoundation\InputBag::get() must be of the type string, null given, called in /var/www/yoursite/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php on line 160 at /var/www/yoursite/vendor/symfony/http-foundation/InputBag.php:30)

Does anyone have any idea what might be happening? The stacktrace doesn't point to any of my code... If I go back to a previous commit and downgrade my composer-packages, the problem goes away. I hope you can help, as currently I'm stuck on a previous commit in my prod-environment.

0 likes
8 replies
GregersBoye's avatar

I did a composer update on my dev-machine, committed and pushed the composer-files and then ran composer install --no-dev on my prod-environment.

neilstee's avatar

@gregersboye that is the issue I think, some packages might require dev dependencies. Try running only composer install and see what happens.

neilstee's avatar

Check your require-dev dependencies, you might have installed a package that went to require instead of require-dev only.

GregersBoye's avatar

Makes sense, though it didn't do any difference. For reference, here's my dependencies: `

"require": {

    "php": ">=7.4",
    "laravel/framework": "^8.0",
    "laravel/socialite": "*",
    "cviebrock/eloquent-sluggable": "*",
    "aws/aws-sdk-php": "*",
    "laravelcollective/html": "*",
    "embed/embed": "*",
    "barryvdh/laravel-dompdf": "*",
    "league/flysystem-aws-s3-v3": "*",
    "sentry/sentry-laravel": "^2.1",
    "barryvdh/laravel-debugbar": "^3.5",
    "laravel/ui": "*",
    "bensampo/laravel-enum": "^3.1",
    "shweshi/opengraph": "^1.1"
},
"require-dev": {
    "mockery/mockery": "*",
    "phpunit/phpunit": "*",
    "symfony/css-selector": "*",
    "symfony/dom-crawler": "*",
    "doctrine/dbal": "*",
    "laravel/ui": "*"
},

`

neilstee's avatar

hmm, can you try clearing your cache?

php artisan config:cache

and maybe composer dump-autoload as well

Sirik's avatar

Try this on production server

composer dump-autoload
composer install
GregersBoye's avatar

Ok, I guess it's time for an update. I tried every suggestion coming in, but nothing worked.

I guess the problem is, that it's project that started out as a laravel 5.3 project back in november '16, which I've updated as laravel matured. Death by a thousand papercuts (I can see it started out using vagrant and bower).

I ended up creating a new laravel-project, and then copying everything (models, controllers, views, events/handlers, policies, seeds, migrations, Requests etc) over, and finally copying the .git-folder/file and submitting that.

That solved my problem, and I guess it's for the better seeing as I'm now working with a clean slate laravel-wise.

Thanks for all the suggestions, I really appreciate it, even though I had to resort to the nuclear option :)

Please or to participate in this conversation.