AdminPage UI error when invoking

Hi guys,

I get an error when calling the adminPage. I dunno why. I’m new to Atlassian forge. I would appreciate it if you helped me out.

manifest.yml

  jira:adminPage:
    - key: settings
      function: admin
      title: Settings
      description: Here you can set up your translator
      label: Translator App
  function:
    - key: admin
      handler: admin.run

admin.jsx file

import ForgeUI, {AdminPage, render, Text} from '@forge/ui';
import api from "@forge/api";

const App = () => {
    return (
        <AdminPage>
            <Text>Hello, world!</Text>
        </AdminPage>
    );
};

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

What I know is that calling my app function produces the error.
picture of the error

1 Like

I believe that you must return a Forge component at the top-level.

Since you’re in the adminPage module, you’re expected to wrap everything in the <AdminPage> component.

Can you try changing to something like this:

const App = () => {
  return (
    <Text>Hello, world!</Text>
  );
};

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

This pattern is used in this example app, as well: Bitbucket

Yea that does make sense but now I get a render error.

const App = () => {
    return (
            <Text>Hello, world!</Text> 
    );
};

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

I’ve found out what it is.
Ridiculous,I had to

npm install @forge/ui@latest

update… thanks for your help man. I appreciated.