nova-inline-relationship icon indicating copy to clipboard operation
nova-inline-relationship copied to clipboard

Fatal Error -> Nova::serving(function (ServingNova $event)

Open rishinikhil opened this issue 5 years ago • 8 comments

I wanted to use the Integration available for the NovaDependencyContainer.

The normal compose require kirschbaum-development/nova-inline-relationship did not pull the integrations folder, hence I used compose require kirschbaum-development/nova-inline-relationship:dev-master.

Now, When I use the package in my code I get the below error, also in link - https://flareapp.io/share/W7zGgA5w#F45

Symfony\Component\Debug\Exception\FatalThrowableError Argument 1 passed to KirschbaumDevelopment\NovaInlineRelationship\NovaInlineRelationshipServiceProvider::KirschbaumDevelopment\NovaInlineRelationship{closure}() must be an instance of KirschbaumDevelopment\NovaInlineRelationship\ServingNova, instance of Laravel\Nova\Events\ServingNova given, called in /var/www/html/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php on line 347

rishinikhil avatar Dec 29 '19 20:12 rishinikhil

@navneetrai please help !

rishinikhil avatar Dec 30 '19 10:12 rishinikhil

@rishinikhil Yeah, we haven't released a new tag with the new integration system yet, which is why you are having to pull from dev-master. But that is an interesting issue. I will spend some time trying to reproduce this error. I may have some questions for you along the way.

brandonferens avatar Dec 30 '19 14:12 brandonferens

@rishinikhil It appears that a change was overwritten during a merge. It should be fixed now. Please pull in the latest code from dev-master and let me know if things are back to working again.

brandonferens avatar Dec 30 '19 14:12 brandonferens

@brandonferens Thanks a lot for your reply 👍 The reason I wanted to try on the integration system was because I was getting the below error image

I had checked out the commits and tested by making the change locally which you have made in the last commit. Now to help you better understand how I am using the NovaDependencyContainer, I am sharing the code snippets.

The resource from where the inline function in called: public function fields(Request $request) { return [ ID::make()->sortable(), BelongsTo::make('School'), HasOne::make('Levels', 'levels', Level::class)->inline(), ]; }`

The content of the resource Levels: public function fields(Request $request) { return [ ID::make()->sortable(), Boolean::make('Role Plays Conducted', 'role_plays'), NovaDependencyContainer::make([ File::make('Role Plays Attachment', 'file_role_plays'), Text::make('Topic of Role Plays', 'role_play_topic'), File::make('Role Play Topics Attachment', 'file_role_play_topic'), ])->dependsOn('role_plays', true), Boolean::make('eLearning Classes Conducted', 'elearning'), ]; }

I hope I am trying to use the integration system in right way. Please advice what is the reason for the issue and how can I resolve it.

rishinikhil avatar Dec 30 '19 16:12 rishinikhil

Thanks @rishinikhil. We will look into this and see if there is a good way to solve it.

brandonferens avatar Dec 30 '19 20:12 brandonferens

I see no issue in the NovaDependencyContainer package, as when I run the Level resource, it works fine with no errors, it happens only when the it is run inline.

rishinikhil avatar Dec 31 '19 03:12 rishinikhil

Any update on this @brandonferens

rishinikhil avatar Jan 02 '20 03:01 rishinikhil

Any update @brandonferens

rishinikhil avatar Jan 09 '20 05:01 rishinikhil