Nested page objects?

Hello,
Is it possible to have nested page objects in codeceptjs?
For example, in my feature file I use pageObject1 which in turn uses a pageObject2.
If yes, is there a particular way of doing it?

This is a skeleton of what I have at the moment:

In my feature test file:
Scenario(’…’, async (I, pageObject1) => {
pageObject1.somefunction1();
})

And in pageObject1.js file I have:
const {pageObject2} = inject();

and in my function:
somefunction1(){
pageObject2.somefunction2();
}

I have the following error when I run the test:
Error: Could not include object pageObject1 from module (path)
Duplicate parameter name not allowed in this context

Any suggestions on this matter?

Thank you in advance.

I’m curious why you want a nested page object like that?

This interesting this is something our tests do and it works absolutely fine, what version of CodeceptJS are you using?

Our usecase is we use page objects as reusable modules for different parts of the application, and sometimes you want to reuse functionality between them