Skip to content
This repository was archived by the owner on Oct 31, 2023. It is now read-only.
This repository was archived by the owner on Oct 31, 2023. It is now read-only.

Package start up order bug #74

@MattyJ007

Description

@MattyJ007

Expected behavior:

When defining the package dependencies in the instant.json file - the order of your dependencies shouldn't matter. Instant OpenHIE should work out which dependencies are needed and their start-up order.

Actual behavior:

If the order of the dependencies goes from base dependency (i.e. core) to intermediate dependencies (i.e. client) the script throws a circular dependency error:

Found 6 packages: client, core, covid19immunization, facility, healthworker, mcsd
Target environment is: docker
(node:28) UnhandledPromiseRejectionWarning: Error: Circular dependency present for id core
    at resolveDeps (/instant/instant.ts:79:42)
    at /instant/instant.ts:95:19
    at Array.forEach (<anonymous>)
    at resolveDeps (/instant/instant.ts:94:43)
    at /instant/instant.ts:95:19
    at Array.forEach (<anonymous>)
    at resolveDeps (/instant/instant.ts:94:43)
    at /instant/instant.ts:104:47
    at Array.forEach (<anonymous>)
    at orderPackageIds (/instant/instant.ts:103:20)

Dependency field:

{
...
"dependencies": ["core", "client"]
}

Switching the dependency order to ["client", "core"] - prevents the error.
This dependency issue was simple to solve now, but more complex package structures may not be solvable with the current script

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions