bearsunday / bearsunday.github.io

BEAR.Sunday manual
https://bearsunday.github.io/
10 stars 48 forks source link

チュートリアルでRay\\Di\\Exception\\Unboundが発生する #247

Closed DaichiYamazaki closed 8 months ago

DaichiYamazaki commented 1 year ago

Bug Report

チュートリアルのHTMLの章で以下のコマンドを実行時エラーが発生する

php bin/page.php get '/?year=2000&month=1&day=1'

エラー

php bin/page.php get '/?year=2000&month=1&day=1'
500 Internal Server Error
content-type: application/vnd.error+json

{
    "message": "Internal Server Error",
    "logref": "8447963f",
    "request": "get page://self/?year=2000&month=1&day=1",
    "exceptions": "Ray\\Di\\Exception\\Unbound(dependency 'MyVendor\\Weekday\\Resource\\App\\Weekday' with name '' used in /Users/daichi.yamazaki/git/MyVendor.Weekday/src/Resource/Page/Index.php:12 ($weekday))",
    "file": "/Users/daichi.yamazaki/git/MyVendor.Weekday/vendor/ray/di/src/di/Arguments.php(56)"
}

インストールされているdiがv2.16.1なため、AppModule.phpに以下を追記してエラーは解消できました

$this->bind(Weekday::class);
koriym commented 8 months ago

@DaichiYamazaki https://github.com/bearsunday/bearsunday.github.io/commit/d486a754d9bbe15f7d4fcb7c9f30aa101adfdf77 で修正しています。issueありがとうございました。