Skip to content

Module name conflicts on a large project #470

@Nek-12

Description

@Nek-12

We're currently using delegated props to define our modules: val featureModule by DI.Module { }

However, a very annoying issue is the java.lang.IllegalStateException: Module "featureModule" has already been imported!

This stems from multiple developers working on different features at the same time.
There are cases where devs develop their features, then merge them to master, which causes the master build to crash on startup, because two developers named their property the same way. If this is apparent during rebase testing cycle, it's annoying, but often it only surfaces after git merges two branches into a master branch, breaking the build on that branch.

Hence the question:

Why are module names needed, is there a way to avoid specifying them or autogenerate them in a more unique manner (e.g. using package name in addition to prop name). Why doesn't koin require module names?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions