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

Package start up order bug #74

Open
MattyJ007 opened this issue Mar 10, 2021 · 0 comments
Open

Package start up order bug #74

MattyJ007 opened this issue Mar 10, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@MattyJ007
Copy link
Collaborator

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

@MattyJ007 MattyJ007 added the bug Something isn't working label Mar 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant