Giter Site home page Giter Site logo

Return value of AG\ElasticApmLaravel\ServiceProvider::getAppConfig() must be of the type array, null returned about elastic-apm-laravel HOT 4 CLOSED

arkaitzgarro avatar arkaitzgarro commented on July 20, 2024
Return value of AG\ElasticApmLaravel\ServiceProvider::getAppConfig() must be of the type array, null returned

from elastic-apm-laravel.

Comments (4)

ivus84 avatar ivus84 commented on July 20, 2024 1

from elastic-apm-laravel.

countless-integers avatar countless-integers commented on July 20, 2024

Please provide:

  • php version
  • laravel version
  • full error message (wrapped in code blocks)

from elastic-apm-laravel.

ivus84 avatar ivus84 commented on July 20, 2024

Hello, thanks for the reply.
PHP Version => 7.4.3
Laravel Framework 8.42.1

composer require arkaitzgarro/elastic-apm-laravel
Warning from https://repo.packagist.org: Support for Composer 1 is deprecated and some packages will not be available. You should upgrade to Composer 2. See https://blog.packagist.com/deprecating-composer-1-
support/
Using version ^3.0 for arkaitzgarro/elastic-apm-laravel
./composer.json has been updated
Loading composer repositories with package information
Warning from https://repo.packagist.org: Support for Composer 1 is deprecated and some packages will not be available. You should upgrade to Composer 2. See https://blog.packagist.com/deprecating-composer-1-
support/
Updating dependencies (including require-dev)
Package operations: 5 installs, 0 updates, 0 removals
  - Installing php-http/discovery (1.14.1): Loading from cache
  - Installing nipwaayoni/elastic-apm-php-agent (v7.5.3): Loading from cache
  - Installing jasny/persist-sql-query (v2.0.0): Loading from cache
  - Installing http-interop/http-factory-guzzle (1.2.0): Loading from cache
  - Installing arkaitzgarro/elastic-apm-laravel (v3.0.7): Loading from cache
php-http/discovery suggests installing php-http/message (Allow to use Guzzle, Diactoros or Slim Framework factories)
nipwaayoni/elastic-apm-php-agent suggests installing php-http/guzzle6-adapter (PSR-18 compatible Guzzle6 adapter)
jasny/persist-sql-query suggests installing jasny/db (Jasny's DB layer for the masses)
arkaitzgarro/elastic-apm-laravel suggests installing php-http/guzzle6-adapter (Guzzle Http client adapter for guzzlehttp/guzzle version 6)
Writing lock file
Generating optimized autoload files
Deprecation Notice: Class App\Console\Kernel located in ********/app\Kernel.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:
//C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Autoload/ClassMapGenerator.php:201
Warning: Ambiguous class resolution, "App\Console\Kernel" was found in both "********/app\Console\Kernel.php" and "********/app\Kernel.php", the first will be us
ed.
composer/package-versions-deprecated: Generating version class...
composer/package-versions-deprecated: ...done generating version class
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

   TypeError 

  Return value of AG\ElasticApmLaravel\ServiceProvider::getAppConfig() must be of the type array, null returned

  at ********\vendor\arkaitzgarro\elastic-apm-laravel\src\ServiceProvider.php:231
    227▕         if ($this->app->bound(VersionResolver::class)) {
    228▕             $config['appVersion'] = $this->app->make(VersionResolver::class)->getVersion();
    229▕         }
    230▕
  ➜ 231▕         return $config;
    232▕     }
    233▕
    234▕     private function isAgentDisabled(): bool
    235▕     {

  1   ********\vendor\arkaitzgarro\elastic-apm-laravel\src\ServiceProvider.php:218
      AG\ElasticApmLaravel\ServiceProvider::getAppConfig()

  2   ********\vendor\arkaitzgarro\elastic-apm-laravel\src\ServiceProvider.php:109
      AG\ElasticApmLaravel\ServiceProvider::getAgentConfig()

   TypeError 

  Return value of AG\ElasticApmLaravel\ServiceProvider::getAppConfig() must be of the type array, null returned

  at ********\vendor\arkaitzgarro\elastic-apm-laravel\src\ServiceProvider.php:231
    227▕         if ($this->app->bound(VersionResolver::class)) {
    228▕             $config['appVersion'] = $this->app->make(VersionResolver::class)->getVersion();
    229▕         }
    230▕
  ➜ 231▕         return $config;
    232▕     }
    233▕
    234▕     private function isAgentDisabled(): bool
    235▕     {

  1   ********\vendor\arkaitzgarro\elastic-apm-laravel\src\ServiceProvider.php:218
      AG\ElasticApmLaravel\ServiceProvider::getAppConfig()

  2   ********\vendor\arkaitzgarro\elastic-apm-laravel\src\ServiceProvider.php:109
      AG\ElasticApmLaravel\ServiceProvider::getAgentConfig()
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

Installation failed, reverting ./composer.json to its original content.

from elastic-apm-laravel.

countless-integers avatar countless-integers commented on July 20, 2024

Can you try composer require arkaitzgarro/elastic-apm-laravel --no-scripts ? Also when you write PHP Version => 7.4.3 does that mean you use PHP 7.4.3 or e.g. 8.0.7?

Probably not related, but you should also look at that warning in the output above: Warning: Ambiguous class resolution, "App\Console\Kernel" was found in both "C:/Users/Barone/git/safariremit/app\Console\Kernel.php" and "C:/Users/Barone/git/safariremit/app\Kernel.php", the first will be used.. Again, probably not related but weird.

from elastic-apm-laravel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.