AxisCommunications / backstage-plugins

Backstage Plugins Created by Axis Communications
MIT License
32 stars 17 forks source link

No implementation available for apiRef{plugin.jira-dashboard} for JiraUserIssuesViewCard #221

Open O5ten opened 1 day ago

O5ten commented 1 day ago

Describe the bug

I'm met with an error when trying to run the latest and greatest of the jira-dashboard and put the homepage component on the landing page.

**Error**
NotImplementedError

**Message**
No implementation available for apiRef{plugin.jira-dashboard}

**Stack Trace**
NotImplementedError: No implementation available for apiRef{plugin.jira-dashboard}
    at useApi (webpack-internal:///../../node_modules/@backstage/core-plugin-api/dist/apis/system/useApi.esm.js:30:11)
    at JiraUserIssuesCard (webpack-internal:///../../node_modules/@axis-backstage/plugin-jira-dashboard/dist/components/JiraUserIssuesCard/JiraUserIssuesCard.esm.js:38:81)
    at renderWithHooks (webpack-internal:///../../node_modules/react-dom/cjs/react-dom.development.js:15486:18)
    at updateFunctionComponent (webpack-internal:///../../node_modules/react-dom/cjs/react-dom.development.js:19612:20)
    at mountLazyComponent (webpack-internal:///../../node_modules/react-dom/cjs/react-dom.development.js:19983:17)
    at beginWork (webpack-internal:///../../node_modules/react-dom/cjs/react-dom.development.js:21627:16)
    at beginWork$1 (webpack-internal:///../../node_modules/react-dom/cjs/react-dom.development.js:27460:14)
    at performUnitOfWork (webpack-internal:///../../node_modules/react-dom/cjs/react-dom.development.js:26591:12)
    at workLoopSync (webpack-internal:///../../node_modules/react-dom/cjs/react-dom.development.js:26500:5)
    at renderRootSync (webpack-internal:///../../node_modules/react-dom/cjs/react-dom.development.

To reproduce

Just followed the guide to set up the plugin and its backend. For me i got versions 1.13.3 for frontend and 4.0.2 for backend. I did not add anything to adapt to the new frontend system because i don't use it.

Screenshots

image

Environment

anicke commented 1 day ago

Are you using the "homepage" component only and not adding anything to the "EntityPage"?

O5ten commented 1 day ago

Exactly. I'm not using the entity component at all.

anicke commented 1 day ago

In that case you have to register the "api" manually, something like this from the statuspage plugin.

But that's not possible at the moment with the Jira plugin since that does not export the "JiraClient". I can create a review later today to export what's needed.


// packages/app/src/apis.ts:

createApiFactory({
    api: statuspageApiRef,
    deps: {
      discoveryApi: discoveryApiRef,
      fetchApi: fetchApiRef,
    },
    factory: ({ discoveryApi, fetchApi }) =>
      new StatuspageClient({ discoveryApi, fetchApi }),
  }),```
O5ten commented 1 day ago

Sounds good, this should really be in the docs. :)

Also i suppose these are the exports you are referring to. image

anicke commented 1 day ago

1.13.4 has been published!

O5ten commented 1 day ago

I'll giv eit a go tomorrow! :)