jira:dashboardGadget - Error: Unexpected child type: object

Hello,
I’m trying Jira dashboard gadget (EAP) module. The code dropped directly from sample https://developer.atlassian.com/platform/forge/ui-kit-components/jira/dashboard-gadget/ returns the error:

Error: Unexpected child type: object. Valid children are @forge/ui components, function components, and strings.

manifest.yml

modules:
  jira:dashboardGadget:
    - key: dashboard-gadget-test
      function: my-function
      title: dashboard-gadget-test
      description: Dggd
      thumbnail: https://developer.atlassian.com/platform/forge/images/icons/issue-panel-icon.svg
  function:
    - key: my-function
      handler: index.run
app:
  id: ari:cloud:ecosystem::app/3ab2151f-94fe-4e15-9ca1-5c59f1154892

index.jsx

import ForgeUI, {
    render,
    DashboardGadget,
    Text,
    useProductContext,
} from "@forge/ui";

const App = () => {
    const {
        extensionContext: { gadgetConfiguration },
    } = useProductContext();

    return (
        <DashboardGadget>
            <Text
                content={`Hello ${gadgetConfiguration.name || "world"}`}
            />
        </DashboardGadget>
    );
};

export const run = render(<App />);

package.json

{
  "name": "dashboardgadget",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@forge/ui": "^1.0.0"
  }
}

What did i miss?

Hi @ArasKucinskas,

We added those docs yesterday and are just about to release a new version of @forge/ui with the DashboardGadget component today, which should solve your issue.

Sorry for the confusion!

1 Like