Skip to content

Decorations not propagated to sibling plugins #2727

@Marsup

Description

@Marsup

Credits go to @jedireza for finding this one.

Registration order has an impact on decorations access, regardless of the use of server.dependency.
For exemple calling server.views with [Vision, Lout] will work, [Lout, Vision] won't : TypeError: Object [object Object] has no method 'views'.

Decorations are only copied on the initialization of the plugins, so while the server.root is always aware of those decorations, this line will not be propagate the decorators to others.

It seems I have 2 choices here :

  • always use server.root.*
  • fix it in hapi, by copying again (maybe here) all the decorations from the root

Willing to make a PR if that's the 2nd case.

Metadata

Metadata

Assignees

Labels

bugBug or defect

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions