Skip to content
New issue

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

Service imports empty when consuming iascable as library #286

Open
NoeSamaille opened this issue Nov 5, 2022 · 1 comment
Open

Service imports empty when consuming iascable as library #286

NoeSamaille opened this issue Nov 5, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@NoeSamaille
Copy link
Contributor

When trying to consume any service using import from import { <SERVICE_NAME>Api } from '@cloudnativetoolkit/iascable'; e.g. CatalogLoaderApi I'm getting:

Request GET /automation/catalog/boms failed with status code 500. TypeError: this.catalogLoader.loadCatalog is not a function
    at /workspace/ascent-bff/dist/helpers/services.helper.js:79:32
    at new Promise (<anonymous>)
    at ServicesHelper.fetchCatalog (/workspace/ascent-bff/dist/helpers/services.helper.js:76:16)
    at /workspace/ascent-bff/dist/helpers/services.helper.js:131:42
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

It looks like the CatalogLoaderApi (and any other api) are empty they are not bound to their corresponding implementation (in that case CatalogLoader) which is weird because I clearly see it in the built code in build/esm/index.js:

{bind: CatalogLoaderApi, to: CatalogLoader}
@NoeSamaille NoeSamaille added the bug Something isn't working label Nov 5, 2022
@NoeSamaille
Copy link
Contributor Author

@seansund FYI, to fix this I exported implementation classes again <SERVICE_NAME> instead of <SERVICE_NAME>Api in index.ts files and I'll release beta.13 if you know how to fix this so I can use <SERVICE_NAME>Api instead I'll be able to revert back to those pretty quickly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant