We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
You can continue the conversation there. Go to discussion →
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I want to create a block (named BlockA) that can be used to wrap other blocks (BlockB), and the BlockB can have the BlockA as a child.
But I'm facing a circular dependency issue, the error is
Error: Cannot access 'BlockA' before initialization
I expect to resolve this by using dynamic imports to avoid the circular dependency issue, like this.
.... BlockB .... content: [ { type: "blocks", name: "blocks", required: false, blocks: async () => { const { BlockA } = await import("../example/blockA.block"); return [ BlockA, ]; }, }, ],
However, blocks don't accept a promise. How can I resolve this? Is it possible to use blocks recursively?
.
Create a two blocks with circular relationships between each other
area: core
Payload: 3.0.0-beta.28 Nextjs: 14.3.0-canary.21
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the Bug
I want to create a block (named BlockA) that can be used to wrap other blocks (BlockB), and the BlockB can have the BlockA as a child.
But I'm facing a circular dependency issue, the error is
I expect to resolve this by using dynamic imports to avoid the circular dependency issue, like this.
However, blocks don't accept a promise. How can I resolve this? Is it possible to use blocks recursively?
Link to the code that reproduces this issue
.
Reproduction Steps
Create a two blocks with circular relationships between each other
Which area(s) are affected? (Select all that apply)
area: core
Environment Info
Payload: 3.0.0-beta.28
Nextjs: 14.3.0-canary.21
The text was updated successfully, but these errors were encountered: