Skip to content

Circular dependencies with generated builder files #1815

@Swahvay

Description

@Swahvay

This is maybe a little fringe, but I'm hoping it's also an easy fix.

When my core library is packaged and used externally, the generated files' references that go through index.ts, will sometimes cause circular dependencies. Specifically, the builders. I've figured out that simple referencing the files directly prevents the loop. I think this stems from a builder being imported through index.ts, so when it also tries to load ents through the same file it won't wait for all of the imports to finish, causing ents to try to load before their bases.

The only fix that needs to happen is to just reference the ents directly. I make these changes manually in my builders and everything works. It's just annoying to have to revert changes in git every time I run codegen for the builders (unless they have meaningful changes, which means I make this change manually again).

src/ent/generated/vaulting_entry/actions/vaulting_entry_builder.ts
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions