Napp / xray-laravel

AWS X-Ray tracing for Laravel apps
MIT License
56 stars 34 forks source link

Target class [Illuminate\\Foundation\\Application] does not exist while using the package with Lumen #50

Open SachinBahukhandi opened 7 months ago

SachinBahukhandi commented 7 months ago

Hi, I have had encountered an issue while installing this package on Lumen.

Steps to reproduce:

  1. Install a new Lumen Empty Project.
  2. Install the library.
  3. Add the steps as suggested in readme.

Stack Trace:

{
    "message": "Target class [Illuminate\\Foundation\\Application] does not exist.",
    "exception": "Illuminate\\Contracts\\Container\\BindingResolutionException",
    "file": "/var/www/open-source/lumen-oss/vendor/illuminate/container/Container.php",
    "line": 914,
    "trace": [
        {
            "file": "/var/www/open-source/lumen-oss/vendor/illuminate/container/Container.php",
            "line": 795,
            "function": "build",
            "class": "Illuminate\\Container\\Container",
            "type": "->"
        },
        {
            "file": "/var/www/open-source/lumen-oss/vendor/illuminate/container/Container.php",
            "line": 731,
            "function": "resolve",
            "class": "Illuminate\\Container\\Container",
            "type": "->"
        },
        {
            "file": "/var/www/open-source/lumen-oss/vendor/laravel/lumen-framework/src/Application.php",
            "line": 327,
            "function": "make",
            "class": "Illuminate\\Container\\Container",
            "type": "->"
        },
        {
            "file": "/var/www/open-source/lumen-oss/vendor/illuminate/container/Container.php",
            "line": 1066,
            "function": "make",
            "class": "Laravel\\Lumen\\Application",
            "type": "->"
        },
        {
            "file": "/var/www/open-source/lumen-oss/vendor/illuminate/container/Container.php",
            "line": 982,
            "function": "resolveClass",
            "class": "Illuminate\\Container\\Container",
            "type": "->"
        },
        {
            "file": "/var/www/open-source/lumen-oss/vendor/illuminate/container/Container.php",
            "line": 943,
            "function": "resolveDependencies",
            "class": "Illuminate\\Container\\Container",
            "type": "->"
        },
        {
            "file": "/var/www/open-source/lumen-oss/vendor/illuminate/container/Container.php",
            "line": 795,
            "function": "build",
            "class": "Illuminate\\Container\\Container",
            "type": "->"
        },
        {
            "file": "/var/www/open-source/lumen-oss/vendor/illuminate/container/Container.php",
            "line": 731,
            "function": "resolve",
            "class": "Illuminate\\Container\\Container",
            "type": "->"
        },
        {
            "file": "/var/www/open-source/lumen-oss/vendor/laravel/lumen-framework/src/Application.php",
            "line": 327,
            "function": "make",
            "class": "Illuminate\\Container\\Container",
            "type": "->"
        },
        {
            "file": "/var/www/open-source/lumen-oss/vendor/laravel/lumen-framework/src/helpers.php",
            "line": 42,
            "function": "make",
            "class": "Laravel\\Lumen\\Application",
            "type": "->"
        },
        {
            "file": "/var/www/open-source/libs/xray-laravel/src/XrayServiceProvider.php",
            "line": 60,
            "function": "app"
        },
        {
            "file": "/var/www/open-source/libs/xray-laravel/src/XrayServiceProvider.php",
            "line": 51,
            "function": "registerCollectors",
            "class": "Napp\\Xray\\XrayServiceProvider",
            "type": "->"
        },
        {
            "file": "/var/www/open-source/lumen-oss/vendor/illuminate/container/BoundMethod.php",
            "line": 36,
            "function": "boot",
            "class": "Napp\\Xray\\XrayServiceProvider",
            "type": "->"
        },
        {
            "file": "/var/www/open-source/lumen-oss/vendor/illuminate/container/Util.php",
            "line": 41,
            "function": "Illuminate\\Container\\{closure}",
            "class": "Illuminate\\Container\\BoundMethod",
            "type": "::"
        },
        {
            "file": "/var/www/open-source/lumen-oss/vendor/illuminate/container/BoundMethod.php",
            "line": 93,
            "function": "unwrapIfClosure",
            "class": "Illuminate\\Container\\Util",
            "type": "::"
        },
        {
            "file": "/var/www/open-source/lumen-oss/vendor/illuminate/container/BoundMethod.php",
            "line": 37,
            "function": "callBoundMethod",
            "class": "Illuminate\\Container\\BoundMethod",
            "type": "::"
        },
        {
            "file": "/var/www/open-source/lumen-oss/vendor/illuminate/container/Container.php",
            "line": 662,
            "function": "call",
            "class": "Illuminate\\Container\\BoundMethod",
            "type": "::"
        },
        {
            "file": "/var/www/open-source/lumen-oss/vendor/laravel/lumen-framework/src/Application.php",
            "line": 304,
            "function": "call",
            "class": "Illuminate\\Container\\Container",
            "type": "->"
        },
        {
            "file": "/var/www/open-source/lumen-oss/vendor/laravel/lumen-framework/src/Application.php",
            "line": 289,
            "function": "bootProvider",
            "class": "Laravel\\Lumen\\Application",
            "type": "->"
        },
        {
            "file": "/var/www/open-source/lumen-oss/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php",
            "line": 165,
            "function": "boot",
            "class": "Laravel\\Lumen\\Application",
            "type": "->"
        },
        {
            "file": "/var/www/open-source/lumen-oss/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php",
            "line": 112,
            "function": "dispatch",
            "class": "Laravel\\Lumen\\Application",
            "type": "->"
        },
        {
            "file": "/var/www/open-source/lumen-oss/public/index.php",
            "line": 28,
            "function": "run",
            "class": "Laravel\\Lumen\\Application",
            "type": "->"
        }
    ]
}{
    "message": "Call to undefined function Napp\\Xray\\Submission\\now()",
    "exception": "Error",
    "file": "/var/www/open-source/libs/xray-laravel/src/Submission/APISegmentSubmitter.php",
    "line": 21,
    "trace": [
        {
            "file": "/var/www/open-source/libs/xray-laravel/src/Collectors/SegmentCollector.php",
            "line": 142,
            "function": "__construct",
            "class": "Napp\\Xray\\Submission\\APISegmentSubmitter",
            "type": "->"
        },
        {
            "file": "/var/www/open-source/libs/xray-laravel/src/Xray.php",
            "line": 81,
            "function": "submitHttpTracer",
            "class": "Napp\\Xray\\Collectors\\SegmentCollector",
            "type": "->"
        },
        {
            "file": "/var/www/open-source/libs/xray-laravel/src/Middleware/RequestTracing.php",
            "line": 32,
            "function": "submitHttpTracer",
            "class": "Napp\\Xray\\Xray",
            "type": "->"
        },
        {
            "file": "/var/www/open-source/lumen-oss/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php",
            "line": 149,
            "function": "terminate",
            "class": "Napp\\Xray\\Middleware\\RequestTracing",
            "type": "->"
        },
        {
            "file": "/var/www/open-source/lumen-oss/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php",
            "line": 121,
            "function": "callTerminableMiddleware",
            "class": "Laravel\\Lumen\\Application",
            "type": "->"
        },
        {
            "file": "/var/www/open-source/lumen-oss/public/index.php",
            "line": 28,
            "function": "run",
            "class": "Laravel\\Lumen\\Application",
            "type": "->"
        }
    ]
}